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

Feature to preserve original file names and file paths in stack (after bunding) #19186

Closed
4 tasks done
pjebs opened this issue Jan 12, 2025 · 4 comments
Closed
4 tasks done

Comments

@pjebs
Copy link

pjebs commented Jan 12, 2025

Description

During npm run dev, the stack trace contains information about the chain of calling functions (most importantly their file name and path).
After npm run build and then npm run preview, the stack trace loses all of that original information (since after bundling it is the one file).

I was wondering if vite can make it possible for me to find that information (without a source map) for some key functions that I can mark to Vite.

Suggested solution

Not sure

Alternative

No response

Additional context

No response

Validations

@pjebs
Copy link
Author

pjebs commented Jan 12, 2025

See: https://github.com/pjebs/vite-issue-19186

See file: src/lib/x.ts, src/lib/Counter.svelte and src/App.svelte.

Dev server
Screen Shot 2025-01-12 at 9 12 08 pm

Prod code:
You will notice I lose the calling function file information (name and path during development)
Screen Shot 2025-01-12 at 9 13 28 pm

@pjebs
Copy link
Author

pjebs commented Jan 12, 2025

It would be awesome if some kind of solution can be found without source maps.
Sourcemaps are simply too large. It would be awesome to mark only a few files that are relevant to me.

@pjebs
Copy link
Author

pjebs commented Jan 12, 2025

Alternative an option to produce very limited sourcemaps so only relevant files (in my case only their filenames for a few source directories) can be mapped to reduce the size of the generated sourcemap.

@hi-ogawa
Copy link
Collaborator

It sounds like you're proposing an entire source map alternative and that's probably out-of-scope for Vite. Let me close this and it might be possible tackle #19187 instead.

@hi-ogawa hi-ogawa closed this as not planned Won't fix, can't repro, duplicate, stale Jan 13, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jan 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants