Closed Because789 closed 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?
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.
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?
As for reproduction. I experienced the issue as well every time I create a project
npm create astro@latest
,i18n: {
defaultLocale: 'en',
locales: ['en', 'de']
}
import { getRelativeLocaleUrl } from 'astro:i18n';
getRelativeLocaleUrl('en');
@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.
@ematipico Can we get confirmation for this?
I saw the warning yesterday, but not today. Is it possible it was just a package management quirk?
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.
Do you see it on dev server start or on request?
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
Thanks, I see it on request too.
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.
Astro Info
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, butEdit: 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:
.astro
,.pnpm-store
,node_modules
,pnpm-lock.yaml
and thenpnpm i
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