Giter VIP home page Giter VIP logo

Comments (19)

michalpulpan avatar michalpulpan commented on June 8, 2024 1

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.

cvolant avatar cvolant commented on June 8, 2024

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.

michalpulpan avatar michalpulpan commented on June 8, 2024

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.

cvolant avatar cvolant commented on June 8, 2024

😮 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.

michalpulpan avatar michalpulpan commented on June 8, 2024

😮 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.

michalpulpan avatar michalpulpan commented on June 8, 2024

@cvolant So I rewrote several _routes.json into fall back languages. I tested that and it sadly did not help 😞.

from next-translate-routes.

cvolant avatar cvolant commented on June 8, 2024

Could you tell me how big are your rewrites?

JSON.stringify(__BUILD_MANIFEST.__rewrites).length

Mine has 9300 characters...

from next-translate-routes.

michalpulpan avatar michalpulpan commented on June 8, 2024

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.

cvolant avatar cvolant commented on June 8, 2024

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.

michalpulpan avatar michalpulpan commented on June 8, 2024

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:
Snímek obrazovky 2023-12-05 v 17 08 03

But npm run build && npm run start works flawlessly (actually never had issue running it outside of docker):
Snímek obrazovky 2023-12-05 v 17 09 05

Commands you suggested previously output following:

  1. #elements in the routes tree: 109
  2. #routes.json files: 20
  3. #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.

cvolant avatar cvolant commented on June 8, 2024

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.

cvolant avatar cvolant commented on June 8, 2024

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.

michalpulpan avatar michalpulpan commented on June 8, 2024

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.

michalpulpan avatar michalpulpan commented on June 8, 2024

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.

LuK3zz avatar LuK3zz commented on June 8, 2024

Is there any possible solution here?

from next-translate-routes.

michalpulpan avatar michalpulpan commented on June 8, 2024

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.

LuK3zz avatar LuK3zz commented on June 8, 2024

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.

LuK3zz avatar LuK3zz commented on June 8, 2024

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.

michalpulpan avatar michalpulpan commented on June 8, 2024

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.

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.