Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error line number is wrong in hooks.server.js #10579

Closed
lazy-detourer opened this issue Aug 18, 2023 · 5 comments
Closed

Error line number is wrong in hooks.server.js #10579

lazy-detourer opened this issue Aug 18, 2023 · 5 comments

Comments

@lazy-detourer
Copy link

Describe the bug

I need a function that runs regularly.
I called it from hooks.server.js.

However, if an error occurs, the location is not correct.
In stackblitz reproduction, the location of the error is line 4, but it is output to line 6.

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-wsaice?file=src%2Fhooks.server.js

hooks.server.js:

console.log('run: hooks.server.js');

setTimeout(() => {
	throw new Error();
}, 5000);

setTimeout(() => {
	console.log('error soon');
}, 4000);

Logs

run: hooks.server.js
error soon
Error
    at Timeout.eval (/home/projects/sveltejs-kit-template-default-wsaice/src/hooks.server.js:6:8)
    at listOnTimeout (node:internal/timers:62:4448)
    at processTimers (node:internal/timers:62:5285)
    at <anonymous> (https://sveltejskittemplatedefaultwsai-dctb-401tc7qf.w-credentialless.staticblitz.com/blitz.ba0db7b1.js:334:285414)
    at <anonymous> (https://sveltejskittemplatedefaultwsai-dctb-401tc7qf.w-credentialless.staticblitz.com/blitz.ba0db7b1.js:334:285713)

System Info

Reproduced in the stackblitz environment.

  System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 16.20.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.4.2 - /usr/local/bin/npm
    pnpm: 8.6.10 - /usr/local/bin/pnpm
  npmPackages:
    svelte: ^4.0.5 => 4.2.0

Severity

annoyance

Additional Information

No response

@ghostdevv
Copy link
Member

is this a duplicate of #10579 ?

@lazy-detourer
Copy link
Author

lazy-detourer commented Aug 19, 2023

is this a duplicate of #10579 ?

You linked to the same URL.

@PixelPete36
Copy link

You by chance ever figure this out?
I just started using stackblitz and it seems like whenever it catches and error, and then throws it in the console, the line number is wrong... I had one that said the error was on line 117, when in fact it was on line 160.

@lazy-detourer
Copy link
Author

You by chance ever figure this out? I just started using stackblitz and it seems like whenever it catches and error, and then throws it in the console, the line number is wrong... I had one that said the error was on line 117, when in fact it was on line 160.

I am still suffering from this.

@eltigerchino
Copy link
Member

closed as duplicate of #10138

@eltigerchino eltigerchino closed this as not planned Won't fix, can't repro, duplicate, stale Sep 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants