-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Description
What version of Next.js are you using?
10.0.5
What version of Node.js are you using?
15.4.0
What browser are you using?
Chrome
What operating system are you using?
Linux
How are you deploying your application?
I'm having the problem in a dev environment; deployment is irrelevant
Describe the Bug
Basically it seems bug #2285 is back. If I get an error from actual line 24 of a file, the stack trace generated shows it coming from line 28 ... which is an empty line in the original source.
I've often seen this sort of thing when using the "wrong" sourcemap settings in Webpack, and I'd be more than happy to try cycling through all the various options to report back which one results in the correct line numbers ... only I have no idea how to tell Next.js what source map settings to give to Webpack.
Expected Behavior
When I get an error in dev, the line number should correspond to the line number in the file (or at least, after the browser translates that line through the source map).
To Reproduce
I'm observing this issue in the middle of a larger app, which I can't submit. However, the one interesting part is that it's coming from a local shared library.
In other words, I have project Foo, and also project Bar in the same folder. Bar has the code for the function (with the incorrect stack trace), but said function is called by Foo. Foo is able to do this because I did npm i ../Bar
.
I realize this is a specific case that others might not have, and again I'm happy to debug on my end to try and get find the correct devtool
(https://webpack.js.org/configuration/devtool/) to resolve it ... I just need to know how I can use different devtool
settings with Webpack when using Next.js