Comments (19)
So after some trial and error, I think I'm back on previous version (both next
and next-translate-routes
). Even though E2BIG seems to be fine, other errors occured which are mentioned in other currently open issues.
#77
from next-translate-routes.
Strange... We run our project under docker too, without any issue.
Could you count the number of elements in your routes tree? Just execute the following code in the console of your browser while it displays your website:
countElements = (children) => children?.reduce((acc, child) => acc + 1 + countElements(child.children), 0) || 0;
countElements(__NEXT_TRANSLATE_ROUTES_DATA.routesTree.children)
And how many routes.json
files do you have?
countRoutesFiles = (children) => children?.reduce((acc, child) => acc + countRoutesFiles(child.children) + (Object.keys(child.paths).length > 1 ? 1 : 0), 0) || 0;
countRoutesFiles(__NEXT_TRANSLATE_ROUTES_DATA.routesTree.children)
I get 80 elements and 37 routes.json
files. Do you have a lot more?
from next-translate-routes.
Hi @cvolant ,
thank you for your response! I get 108 elements and 18 routes.json. However, I've reduced number of routes.json in order to prevent this error.
I tried to add few more and 109 elements and 20 files + 1 file would make it crash with this error.
Hope it makes sense like this. I've a feeling it has something to do with my _routes.json
having quite a lot of languages?
{
"/": {
"cs": "objednavka",
"sk": "objednavka",
"en": "order",
"de": "auftrag",
"pl": "zamowienie",
"default": "objednavka",
"cs-CZ": "objednavka",
"en-BE": "order",
"en-BG": "order",
"en-CY": "order",
"en-DK": "order",
"de-DE": "auftrag",
"en-EE": "order",
"en-FI": "order",
"en-FR": "order",
"en-GR": "order",
"en-HU": "order",
"en-IE": "order",
"en-IT": "order",
"en-LV": "order",
"en-LT": "order",
"en-LU": "order",
"en-MT": "order",
"en-NL": "order",
"pl-PL": "zamowienie",
"en-PT": "order",
"en-RO": "order",
"en-SI": "order",
"sk-SK": "objednavka",
"en-ES": "order",
"en-SE": "order",
"en-GB": "order",
"de-AT": "auftrag"
}
}
I'm honestly not sure why I don't use fallback languages as of #66 since it's quite some time since I digged into this issue and ended up banging my head against wall and just not translating some of the routes 😅
from next-translate-routes.
😮 I can't imagine what your redirects/rewrites look like ! 😄
Indeed, fallback languages is probably the way to go. I hope it will solve you issue.
from next-translate-routes.
😮 I can't imagine what your redirects/rewrites look like ! 😄 Indeed, fallback languages is probably the way to go. I hope it will solve you issue.
Well! They're pretty big 🙈. However, this ended up beeing the best solution for making Next.js locale
feature work with locale-COUNTRY
coding in eCommerce 👎.
from next-translate-routes.
@cvolant So I rewrote several _routes.json
into fall back languages. I tested that and it sadly did not help 😞.
from next-translate-routes.
Could you tell me how big are your rewrites?
JSON.stringify(__BUILD_MANIFEST.__rewrites).length
Mine has 9300 characters...
from next-translate-routes.
Interesting and thank you - mine in the working situation (so few _routes.json
less) has 8686 characters. 🤔 So it might not be what I think...
from next-translate-routes.
Difficult to say. Do you have a working configuration without Docker but with all the routes files ? If you reach ~8000 with a few routes files, you probably end up with a lot bigger rewrites objet... The redirects object could be the cause too : it is bigger than the rewrites one, but is more difficult to measure since it does not reach the browser...
from next-translate-routes.
Hi! I'm sorry it took me that long; it has been a hectic period on my end lately.
Do you have a working configuration without Docker but with all the routes files
Yes, of course! I modified my project so that it's in the state where docker looks like:
But npm run build && npm run start
works flawlessly (actually never had issue running it outside of docker):
Commands you suggested previously output following:
- #elements in the routes tree: 109
- #
routes.json
files: 20 - #characters in rewrites: 10814
Number of rewrites has a significant increase, but I guess it's mostly due to the fact that some of my routes look like .../.../shipping-billing-details
.
Do you think that might be the cause of the issue? So that the Node worker can't maybe allocate enough memory inside of the container to store that?
Thank you very much for your help 🙏
from next-translate-routes.
I am a total newbie on Docker, so I am quite helpless here, but the numbers you gave don't seem to be that much, and we use Docker too with similar numbers, without such an issue...
from next-translate-routes.
I asked our Docker master Jedi, and he says that it looks more like a Node issue than a Docker issue, but that you seem to be on MacOS where Docker could behave a bit differently. Could you try to run your project on a Linux distro and check if you still have the issue? What version of Docker do you use?
from next-translate-routes.
Thank you very much for quick response! Sadly, it crashes on both MacOS and on our production Ubuntu 22.04 with Docker 23.0.1 🙁
from next-translate-routes.
Thank you very much for quick response! Sadly, it crashes on both MacOS and on our production Ubuntu 22.04 with Docker 23.0.1 🙁
By the way, I'm using 1:1 Dockerfile from https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile and tested node:20-alpine and node:21-alpine
from next-translate-routes.
Is there any possible solution here?
from next-translate-routes.
Is there any possible solution here?
Do you have the same issue? 🤔 I haven't resolved it, we just kept only most crucial urls translated and all new ones are untranslated for now.
from next-translate-routes.
Is there any possible solution here?
Do you have the same issue? 🤔 I haven't resolved it, we just kept only most crucial urls translated and all new ones are untranslated for now.
Yes, I have the same issue 😞 I have to proceed with the solution that some languages will not have translations.
from next-translate-routes.
That's how I managed to solve this case. It was enough to update next
to version 13.5.2
and slightly modify next-translate-routes
.
In version 13.5.2
a new thing cleanup was added. The new thing added in next
seems to have solved this problem.
from next-translate-routes.
That's how I managed to solve this case. It was enough to update
next
to version13.5.2
and slightly modifynext-translate-routes
.In version
13.5.2
a new thing cleanup was added. The new thing added innext
seems to have solved this problem.
Good point! So you're now running with no issues? I was stuck on older version (13.4.2
) due to this (Next.js problem)[https://github.com/vercel/next.js/issues/54765]. However I think it's time to give it a try. Would you mind sharing how did you fixed the ROUTER_CONTEXT_PATH
error comming from [email protected]
?
Thanks!
edit: nevermind, #86 (comment) seems to do the trick :)
from next-translate-routes.
Related Issues (20)
- fileUrlToUrl breaks on 404 HOT 2
- Add support for Next 13 `/app` directory HOT 4
- Update LinkProps to support Next.js 13 <Link> component HOT 2
- Update pagesDirs to support Next.js 11 pages path HOT 1
- Next Link supports ref, but next-translate-routes does not HOT 1
- Routing does not work any more after update to next 13.3.0 HOT 7
- Add the ability to export the translations directly from the pages HOT 1
- How can I use it in storybook? HOT 1
- Static segment after dynamic segment? HOT 2
- How to work with dynamic routes? HOT 1
- The page could not be found on refresh HOT 2
- Mailto links are broken since v.1.9.2 HOT 1
- The querystring API is considered Legacy
- 404 req when deployed on Vercel HOT 8
- Module not found: Can't resolve 'next/dist/shared/lib/router-context' HOT 3
- Redirection issue using getServerSideProps HOT 2
- codesandbox link in readme isn't working
- Module not found: Can't resolve 'next/dist/shared/lib/router-context' HOT 8
- I'm using [email protected] with pages router, but still getting the "does not support `/app` directory yet." error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from next-translate-routes.