-
Notifications
You must be signed in to change notification settings - Fork 12
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 v3: dev
server returns 404
for other locales when using [dynamic].astro
paths
#19
Comments
You are right! One change that is needed is updating the imports in the import { i18n, defaultLocaleSitemapFilter } from "astro-i18n-aut/integration"; However, from what I’ve tested, I believe the |
Follow withastro/astro#8241 for updates |
npm run dev
starts (astro:content)npm run dev
starts (astro:content)
npm run dev
starts (astro:content)npm run dev
starts (astro:content)
npm run dev
starts (astro:content)dev
server returns 404
when using [dynamic].astro
paths
dev
server returns 404
when using [dynamic].astro
pathsdev
server returns 404
for other locales when using [dynamic].astro
paths
Similar issues here. I've been trying for days but can't make heads or tails of the erratic behavior, both in dev and preview modes. |
Hey @ansmlc there was an issue with handling trailing slashes that I just fixed, please try again with the latest version! If you have an issue with translations in |
Also @ansmlc if you have a repository or example project I could look at, please send it my way |
@jlarmstrongiv Please is this still an issue? I'd like to know before I get to work on a blog, I'd like to have this clarified. I'm assuming that it still happens with version 4 of astro, am I right? Also I see that you updated the status of this issue, but I have figured that I'd still ask just to be sure. Thanks! |
To save you some time, this indeed still happens. My setup was slightly different, but dev server returns erratic 404's and build/preview is fine. |
@dallyh feel free to ask in the Astro discord. I’ve done everything I can to try and get that issue prioritized. |
Problem:
I using this package with
astro:content
, but can't achieve stable behaviour of my blog when I working on routing to content.I assumed convention when the first component of the path is language if it is a language different than English.
Example for static pages:
/
- main page in English/pl
- main page in PolishExample for blog posts
/post/hello-world
- blog post in English/pl/post/widaj-swiecie
- blog post in PolishI have no problem with static pages, like
index
orabout
but for content I see that some posts work or do not work depending on the page on which I have opened the browser during thenpm run dev
command.Test
I have closed the browser. I starting my blog.
I see http://localhost:3000/ in English, http://localhost:3000/pl in Polish, and http://localhost:3000/es in Spanish as I expected.
My blog post http://localhost:3000/post/hi is displayed correctly.
but when I enter http://localhost:3000/pl/post/witaj-swiecie I see 404.
To see its content I have to use http://localhost:3000/post/witaj-swiecie but then I lose info about the language in the URL and the language of the rest layout is wrongly recognized.
But it is only half of the problem...
Now I typing http://localhost:3000/pl/post/witaj-swiecie in the browser address again to see 404.
I turned down the server in the Linux console.
Then typed
again and saw my Polish blog post on http://localhost:3000/pl/post/witaj-swiecie
But... it is not a solution because of when I entered now
http://localhost:3000/pl or http://localhost:3000/ I see it works because these are static pages, but when I want to check an English blog post and type
http://localhost:3000/post/hi
I see now 404, to see this post I can't see it even typing
http://localhost:3000/en/post/hi
because I am instantly redirected to http://localhost:3000/post/hi
In the console, I can see warnings
I created the branch
astro-i18n-aut
in my blog so you can reproduce it.https://github.com/gustawdaniel/gustawdaniel/tree/astro-i18n-aut
Update 1
I found an example #8 and it works great. I investigating where I made bug.
Update 2
I downloaded your example from mentioned issue and it was working perfectly until I typed
Then I seed error
and when I removed
I was able to reproduce the same error using your code
astro-i18n-blog
Update 3
To simplify reproduction I used your example and created 2 branches:
First - your original code with blog, when we do not see this error (it works but has outdated packages)
https://github.com/gustawdaniel/gustawdaniel/tree/astro-i18n-blog-no-update
Second - with a bug that is possible to reproduce after the npm update
https://github.com/gustawdaniel/gustawdaniel/tree/astro-i18n-blog-npm-update
There is open PR with changes in
package-lock.json
that was reason of problem.https://github.com/gustawdaniel/gustawdaniel/pull/7/files
Potentially connected issues:
withastro/astro#8226
withastro/astro#8236
withastro/astro#7808
The text was updated successfully, but these errors were encountered: