-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Sourcemaps don't work in vm.Script scripts #52102
Labels
source maps
Issues and PRs related to source map support.
vm
Issues and PRs related to the vm subsystem.
Comments
atlowChemi
added
vm
Issues and PRs related to the vm subsystem.
source maps
Issues and PRs related to source map support.
labels
Mar 17, 2024
i also have this problem,Is this problem solved now?
|
This affects bundlers like Webpack and Turbopack that use |
eps1lon
added a commit
to vercel/next.js
that referenced
this issue
Nov 18, 2024
Works around nodejs/node#52102 Webpack will be harder to patch and I don't know yet where the Webpack runtime is using `vm.runInThisContext`. Best way to observe change is in #71909 and `pnpm test-dev-turbo test/development/app-dir/dynamic-io-dev-errors/ -t "should display error when component accessed data without suspense boundary"`. Before: ``` Error: [...] at Page [Server] (<anonymous>) at InnerLayoutRouter (.next/server/chunks/ssr/[root of the server]__088b8c._.js) ``` After: ``` Error: [...] at Page [Server] (<anonymous>) at InnerLayoutRouter (node_modules/.pnpm/file+..+next-repo-2186278d37ae48e2b1397aa86060054592669ed9909b91e96c5af049d12c04c3+packages+n_vk62popbath6ofshgazcbhzdoe/node_modules/next/dist/src/client/components/layout-router.tsx:324:2) ``` Next step is figuring out why the now sourcemapped frames aren't ignore-listed.
wyattjoh
pushed a commit
to vercel/next.js
that referenced
this issue
Nov 28, 2024
Works around nodejs/node#52102 Webpack will be harder to patch and I don't know yet where the Webpack runtime is using `vm.runInThisContext`. Best way to observe change is in #71909 and `pnpm test-dev-turbo test/development/app-dir/dynamic-io-dev-errors/ -t "should display error when component accessed data without suspense boundary"`. Before: ``` Error: [...] at Page [Server] (<anonymous>) at InnerLayoutRouter (.next/server/chunks/ssr/[root of the server]__088b8c._.js) ``` After: ``` Error: [...] at Page [Server] (<anonymous>) at InnerLayoutRouter (node_modules/.pnpm/file+..+next-repo-2186278d37ae48e2b1397aa86060054592669ed9909b91e96c5af049d12c04c3+packages+n_vk62popbath6ofshgazcbhzdoe/node_modules/next/dist/src/client/components/layout-router.tsx:324:2) ``` Next step is figuring out why the now sourcemapped frames aren't ignore-listed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
source maps
Issues and PRs related to source map support.
vm
Issues and PRs related to the vm subsystem.
Version
v21.7.1
Platform
Linux ecls 6.5.0-25-generic #25~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Feb 20 16:09:15 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
source_map
What steps will reproduce the bug?
This example is adapted from #43047
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior? Why is that the expected behavior?
The expected behavior is shown if I uncomment the
eval
call infoo.js
and run the code:Now, the traceback shows the error in the CoffeeScript code.
What do you see instead?
Running this code from file
foo.js
gives:Note that the traceback shows the JavaScript source, not the CoffeeScript source.
Additional information
Note that the
vm.Script
module correctly parses thesourceMappingURL
comment, and displays its contents. This led me to believe that the source map would be supported during execution!I'm sorry if I have overlooked other issues in this area; I have only found the issue I referred to above about adding support for source maps to
eval
.The text was updated successfully, but these errors were encountered: