next-translate: Bug when wrapping index in folder
Hello, we found a bug just before the deploy that blocks us from using this lib π¦.
If we wrap the pages_/index.tsx inside a folder, like index/index.tsx it will break on all the languages but default one when building static. Navigating to site.com/es throws a weird error on compiled js files.
How to reproduce
- Configure two or more languages
- Wrap your index page inside a folder
pages_/index/index.tsx - Build static and export
- Run a local server inside the dist folder and manually navigate to the index of any of the non-default language, like
localhost:3000/es/
Output
dist/
βββ index.html
βββ my-page.html
βββ es.html
βββ es/
βββ βββ my-page.html
Expected output
dist/
βββ index.html
βββ my-page.html
βββ es/
βββ βββ index.html
βββ βββ my-page.html
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 30 (13 by maintainers)
Next 9.5 is out. I will try it with latest next-translate official release
I tried next
9.4.5-canary.8+0.17.1,0.17.1-canary.1and0.17.1-canary.2with the index folder. The default langindex.htmlis missing from the dist root:pages_andpage:dist
@thissell @equinusocio I see that in Next.js 9.4.5-canary.8 version there is a PR changing this
/index/index.jsbehavior.Which Next.js version do you have? Can you try a Next.js version >= than 9.4.5-canary.8?
If itβs a Next.js issue, maybe we can revert a part of this PR: https://github.com/vinissimus/next-translate/pull/200 to keep the
/index/index.jsstructure again.@equinusocio I did another pre-release, 0.17.2-canary.2 with the change that you proposed (just copy the css/scss files instead of ignore them).
Iβm getting the same issue. All subdirectories with index.js files simply call 404 requests. Bumping this for solidarity.
This is with wrapped index
Iβve added an additional bug in this comment, but donβt know if itβs related to this one.
Nope π¦ it doesnβt seem to solve the issue. I tried:
modulefrom the filenameNothing is changing π. It doesnβt seem related to the css.