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

Astro 2.0 warning when using sourcemaps #6058

Closed
1 task
JLarky opened this issue Jan 31, 2023 · 3 comments · Fixed by #6114 or #6817
Closed
1 task

Astro 2.0 warning when using sourcemaps #6058

JLarky opened this issue Jan 31, 2023 · 3 comments · Fixed by #6114 or #6817
Assignees
Labels
- P3: minor bug An edge case that only affects very specific usage (priority)

Comments

@JLarky
Copy link
Contributor

JLarky commented Jan 31, 2023

What version of astro are you using?

2.0.4

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

yarn

What operating system are you using?

Mac

Describe the Bug

Starting from 2.0 running astro build causes this warning when using sourcemaps. I haven't tested it thoroughly, but it seems like this is just a warning and sourcemaps for my code are still there.

Warning:

09:45:56 PM [build] Building static entrypoints...
Sourcemap is likely to be incorrect: a plugin (astro:scanner) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help
Sourcemap is likely to be incorrect: a plugin (astro:scanner) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help
09:45:56 PM [build] Completed in 328ms.

stackblitz is just a fork of default astro template where I enabled sourcemaps and ran build:

image

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-ytzf7d?file=astro.config.mjs&startScript=build

Participation

  • I am willing to submit a pull request for this issue.
@bluwy bluwy added the - P3: minor bug An edge case that only affects very specific usage (priority) label Feb 3, 2023
@JLarky
Copy link
Contributor Author

JLarky commented Feb 12, 2023

hey, didn't mean to rain on your parade, but :)

while the simplest possible case (the stackblizt link that I created) was fixed, I still see those errors in my production website

image

here's an example of latest (2.0.10) build that produces the same warnings https://github.com/JLarky/qgp.app/actions/runs/4153799688/jobs/7185669325

image

@bluwy
Copy link
Member

bluwy commented Feb 12, 2023

Seems to be caused by

return { code: escapeViteEnvReferences(code) };

That might need magic-string to replace and generate a new sourcemap.

@bluwy bluwy reopened this Feb 12, 2023
@bluwy bluwy self-assigned this Feb 12, 2023
@JerryWu1234
Copy link
Contributor

mark

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