[Debugging] Using turbopack seems to have some translation error on sourcemaps when it encounters encoded url paths.
theceejay123 opened this issue · 1 comments
Link to the code that reproduces this issue
https://github.com/theceejay123/with-turbopack-app
To Reproduce
- Clone
https://github.com/theceejay123/with-turbopack-app.git
and install node_modules - Open folder in vscode editor, then 'Start Debugging'
- Add a breakpoint in with-turbopack-app\app\page.tsx; (I used line 5 as my breakpoint)
- It will now show you that the breakpoint you added is unbounded:
- Go to the browser that just opened (this is assuming you have chrome running since it is under debugWithChrome). Go devtools and under Sources, make sure to group the files into Authored and Deployed
- Find your folder structure that has with-turbopack-app as it is different for each user, and add a breakpoint in the debugger here:
- Now refresh the page and you will find that the file that it opens is under the _next folder that is dynamically created when you run next and is using your computers memory
Current vs. Expected behavior
I expect that the breakpoint be hit under the pretext that the sourcemap is using the local instance and not the memory.
Instead what i get is that the file being read is under _next. The default sourcemap that it uses is the one that is built under _next.
Only when adding a
"sourceMapPathOverrides": { "file://B%3A/_devlib/web/with-turbopack-app/*": "${workspaceFolder}/*" }
And overriding the url-encoded path as you see here
Note
The "B%3A" is irrelevant here because that is my drive and is only a part of the issue because of how turbopack handles the encoding of special characters when trying to map the sourcemaps to its local versions.
will make the breakpoint succeed in getting hit
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 11 Pro
Available memory (MB): 32678
Available CPU cores: 12
Binaries:
Node: 21.6.1
npm: 10.2.4
Yarn: N/A
pnpm: 9.14.4
Relevant Packages:
next: 15.1.0 // Latest available version is detected (15.1.0).
eslint-config-next: 15.1.0
react: 19.0.0
react-dom: 19.0.0
typescript: 5.7.2
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Developer Experience, Testing, Turbopack
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
No response
Found another issue containing this.
My issue is a duplicate. will contribute to this open issue instead.