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

Source maps in VSCode not working for debug if white space is in url #17977

Open
7 tasks done
ondrejrohon opened this issue Aug 30, 2024 · 2 comments
Open
7 tasks done
Labels
feat: sourcemap Sourcemap support p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@ondrejrohon
Copy link

Describe the bug

I can't debug using inline VSCode debugger when space is in url of the file. Please check the issue in SvelteKit repo: sveltejs/kit#12625 (comment)

Reproduction

sveltejs/kit#12625

Steps to reproduce

Please check SvelteKit issue with detailed instructions how to reproduce this issue: sveltejs/kit#12625

System Info

Visual Studio Code

Version: 1.92.2
Commit: fee1edb8d6d72a0ddff41e5f71a671c23ed924b9
Date: 2024-08-14T17:29:30.058Z
Electron: 30.1.2
ElectronBuildId: 9870757
Chromium: 124.0.6367.243
Node.js: 20.14.0
V8: 12.4.254.20-electron.0
OS: Darwin x64 23.6.0

Used Package Manager

npm

Logs

No response

Validations

@silllli
Copy link

silllli commented Sep 11, 2024

I think I might have the same issue. I also use SvelteKit and sync my files across devices using iCloud Drive. macOS puts iCloud Drive files into a directory featuring a whitespace (~/Library/Mobile Documents/com~apple~CloudDocs). The whitespace causes the error logs during development to become useless. That’s what they look like when in a directory using a whitespace in its name:

TypeError: Cannot read properties of undefined (reading 'src')
    at eval (eval at instantiateModule (file:///Users/sl/Library/Mobile%20Documents/com~apple~CloudDocs/2401_project/frontend/node_modules/vite/dist/node/chunks/dep-BaOMuo4I.js:52895:24), <anonymous>:43:27)
    at Object.$$render (eval at instantiateModule (file:///Users/sl/Library/Mobile%20Documents/com~apple~CloudDocs/2401_project/frontend/node_modules/vite/dist/node/chunks/dep-BaOMuo4I.js:52895:24), <anonymous>:153:16)
    at eval (eval at instantiateModule (file:///Users/sl/Library/Mobile%20Documents/com~apple~CloudDocs/2401_project/frontend/node_modules/vite/dist/node/chunks/dep-BaOMuo4I.js:52895:24), <anonymous>:68:129)
    at $$render (eval at instantiateModule (file:///Users/sl/Library/Mobile%20Documents/com~apple~CloudDocs/2401_project/frontend/node_modules/vite/dist/node/chunks/dep-BaOMuo4I.js:52895:24), <anonymous>:153:16)
    at Object.render (eval at instantiateModule (file:///Users/sl/Library/Mobile%20Documents/com~apple~CloudDocs/2401_project/frontend/node_modules/vite/dist/node/chunks/dep-BaOMuo4I.js:52895:24), <anonymous>:161:17)
    at Module.render_response (eval at instantiateModule (file:///Users/sl/Library/Mobile%20Documents/com~apple~CloudDocs/2401_project/frontend/node_modules/vite/dist/node/chunks/dep-BaOMuo4I.js:52895:24), <anonymous>:127:33)
    at async Module.render_page (eval at instantiateModule (file:///Users/sl/Library/Mobile%20Documents/com~apple~CloudDocs/2401_project/frontend/node_modules/vite/dist/node/chunks/dep-BaOMuo4I.js:52895:24), <anonymous>:296:10)
    at async resolve (eval at instantiateModule (file:///Users/sl/Library/Mobile%20Documents/com~apple~CloudDocs/2401_project/frontend/node_modules/vite/dist/node/chunks/dep-BaOMuo4I.js:52895:24), <anonymous>:460:18)
    at async Module.respond (eval at instantiateModule (file:///Users/sl/Library/Mobile%20Documents/com~apple~CloudDocs/2401_project/frontend/node_modules/vite/dist/node/chunks/dep-BaOMuo4I.js:52895:24), <anonymous>:333:20)
    at async file:///Users/sl/Library/Mobile%20Documents/com~apple~CloudDocs/2401_project/frontend/node_modules/@sveltejs/kit/src/exports/vite/dev/index.js:524:22

And the same project without whitespace in its path:

TypeError: Cannot read properties of undefined (reading 'src')
    at /Users/sl/Offline/2401_project/frontend/src/routes/+layout.svelte:36:63
    at Object.$$render (/Users/sl/Offline/2401_project/frontend/node_modules/svelte/src/runtime/internal/ssr.js:134:16)
    at /Users/sl/Offline/2401_project/frontend/.svelte-kit/generated/root.svelte:46:40
    at $$render (/Users/sl/Offline/2401_project/frontend/node_modules/svelte/src/runtime/internal/ssr.js:134:16)
    at Object.render (/Users/sl/Offline/2401_project/frontend/node_modules/svelte/src/runtime/internal/ssr.js:142:17)
    at Module.render_response (/Users/sl/Offline/2401_project/frontend/node_modules/@sveltejs/kit/src/runtime/server/page/render.js:171:29)
    at async Module.respond_with_error (/Users/sl/Offline/2401_project/frontend/node_modules/@sveltejs/kit/src/runtime/server/page/respond_with_error.js:85:10)
    at async Module.render_page (/Users/sl/Offline/2401_project/frontend/node_modules/@sveltejs/kit/src/runtime/server/page/index.js:305:10)
    at async resolve (/Users/sl/Offline/2401_project/frontend/node_modules/@sveltejs/kit/src/runtime/server/respond.js:449:18)
    at async Module.respond (/Users/sl/Offline/2401_project/frontend/node_modules/@sveltejs/kit/src/runtime/server/respond.js:322:20)

@sapphi-red sapphi-red added p3-minor-bug An edge case that only affects very specific usage (priority) feat: sourcemap Sourcemap support labels Sep 26, 2024
@sapphi-red
Copy link
Member

Simply escaping the space with %20 didn't work. It seems we need to convert the IDs to fileURLs.
The problem here is that we don't know if the ID is a file path or a virtual module when we process the source map.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: sourcemap Sourcemap support p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

No branches or pull requests

3 participants