withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
46.66k stars 2.48k forks source link

[WARN] [vite] Sourcemap for ".../node_modules/.pnpm/astro@4.5.9_typescript@5.4.3..." points to missing source files #10558

Closed Because789 closed 7 months ago

Because789 commented 7 months ago

Astro Info

Astro                    v4.5.9
Node                     v20.11.1
System                   Linux (x64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             @astrojs/mdx
                         @astrojs/tailwind
                         astro-icon

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

I suddenly get the following warning, when starting the dev server:

[WARN] [vite] Sourcemap for "/workspaces/s4f-astro-fresh/node_modules/.pnpm/astro@4.5.9_typescript@5.4.3/node_modules/astro/dist/virtual-modules/i18n.js" points to missing source files

But the site seemingly runs without any issue, check and build are successful. I also wasn't able to reproduce it by simply adding my dependencies to a fresh install (see below), so I guess it's on my end. I'm implementing i18n functionality, therefore it's very possible I messed something up, but

Edit: It isn't on my end, it's a bug (I guess a minor one, since it doesn't affect how the site runs, at least as far I'm aware of). This related issue https://github.com/withastro/astro/issues/10574 is solved now, but [WARN] [vite] remains for OP. There is now a proper minimal reproduction below.

I have no clue, how to get rid of it. I tried:

Nothing helped. Has anyone a clue, what the issue is and how to resolve it?

What's the expected result?

Start dev server without warning.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/withastro-astro-tpzr3w?file=src%2Fpages%2Findex.astro

Participation

ematipico commented 7 months ago

I'm implementing i18n functionality, therefore it's very possible I messed something up

The reproduction doesn't have anything around i18n routing. Did you miss something?

github-actions[bot] commented 7 months ago

Hello @Because789. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with needs repro will be closed if they have no activity within 3 days.

Because789 commented 7 months ago

I'm implementing i18n functionality, therefore it's very possible I messed something up

The reproduction doesn't have anything around i18n routing. Did you miss something?

Not that I missed something, but I have no idea which part of my i18n could cause it. There are no type errors, checks go through, it builds, the site runs. I thought it might be a dependency update which caused it, that's why I only added them to the minimal reproduction so far. The i18n stuff is cluttered over my whole project, it might take hours to get to a proper minimal reproduction. That's why I thought I'll ask first, if that's a known issue.

Would it help if I make my repo public? And if not, any hints on what could cause it, so that I don't have to start rebuilding my whole project for a minimal reproduction until I run into the error?

atennert commented 7 months ago

As for reproduction. I experienced the issue as well every time I create a project

Because789 commented 7 months ago

@atennert you are a savior, it would have taken ages to pin it down to that since I had no idea where to start. Thanks so much!

Here ist the minimial reproduction. I updated OP.

Because789 commented 7 months ago

@ematipico Can we get confirmation for this?

lilnasy commented 7 months ago

I saw the warning yesterday, but not today. Is it possible it was just a package management quirk?

Because789 commented 7 months ago

Hm, I just updated my project, to the latest dependencies and the warning is still there (pnpm 8.15.5). I also updated the minimial reproduction to latest and the warning is still on (npm 10.2.3).

Really curious stuff. I'm willing to further test things, but I would need some pointers on where to start.

lilnasy commented 7 months ago

Do you see it on dev server start or on request?

Because789 commented 7 months ago

I'd say on request, but not 100% sure. It's the same on my project and the minimal reproduction anyway. When I start the dev server in VS Code on my project and I don't open the site in the browser, this is what I get:

 astro  v4.5.12 ready in 696 ms

┃ Local    http://localhost:4321/
┃ Network  use --host to expose

19:55:51 watching for file changes...

🌼   daisyUI 4.9.0
├─ ✔︎ 2 themes added             https://daisyui.com/docs/themes
╰─ ❤︎ Support daisyUI project:   https://opencollective.com/daisyui

19:56:26 [WARN] [vite] Sourcemap for "/workspaces/s4f-astro-fresh/node_modules/.pnpm/astro@4.5.12_typescript@5.4.3/node_modules/astro/dist/virtual-modules/i18n.js" points to missing source files
19:56:27 [200] / 1264ms
lilnasy commented 7 months ago

Thanks, I see it on request too.

bluwy commented 7 months ago

It's an upstream issue: https://github.com/vitejs/vite/issues/15771. I think it's better to track that issue since there's not much we can do here, I'll check on its PR to fix this.