Skip to content
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

⚗️ Demonstrate app-dir example not working on 13.5.x: "locale: service-worker.js" #1160

Closed
wants to merge 2 commits into from

Conversation

boredland
Copy link
Contributor

@boredland boredland commented Oct 15, 2023

Getting a 404 instead of anything. Not sure what happens here.

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update
[ ] Bug fix
[ ] New feature
[x] Other, please explain:

What changes did you make? (Give an overview)

Upgraded the app-dir example to the current versions of next-translate and next.

Which issue (if any) does this pull request address?

I want to demonstrate, that currently, I can't get the app-directory to work.

If you access for example http://localhost:3000/en, it renders a 404 page and prints the following on the terminal:

next-translate - compiled page: /[lang] - locale: service-worker.js - namespaces: common, home - used loader: server /layout
 ⨯ ../lib/cjs/createTranslation.js (16:21) @ createTranslation
 ⨯ RangeError: Incorrect locale information provided
    at new PluralRules (<anonymous>)
    at createTranslation (../../lib/cjs/createTranslation.js:22:22)
    at useTranslation (../../lib/cjs/useTranslation.js:38:12)
    at RootLayout (./src/app/[lang]/layout.tsx:23:98)
    at stringify (<anonymous>)
  14 |         config: config,
  15 |         allNamespaces: namespaces,
> 16 |         pluralRules: new Intl.PluralRules(ignoreLang ? undefined : lang),
     |                     ^
  17 |         lang: lang,
  18 |     });
  19 |     return { t: (0, wrapTWithDefaultNs_1.default)(t, defaultNS), lang: lang };
 ⨯ ../lib/cjs/createTranslation.js (16:21) @ createTranslation

Is there anything you'd like reviewers to focus on?

May for example be related to #1142, but aralroca/next-translate-plugin#72 gave me hope this could work again.

Getting a 404 instead of anything. Not sure what happens here.
@boredland boredland changed the title ⚗️ Demonstrate app-dir example not working on 13.5: "locale: service-worker.js" ⚗️ Demonstrate app-dir example not working on 13.5.x: "locale: service-worker.js" Oct 15, 2023
@aralroca
Copy link
Owner

Ok, that's weird... I'm going to investigate what is happening... Meanwhile, probably you can workaround using localesToIgnore: ['service-worker.js'] in the configuration

@boredland
Copy link
Contributor Author

Ok, that's weird... I'm going to investigate what is happening... Meanwhile, probably you can workaround using localesToIgnore: ['service-worker.js'] in the configuration

I already tried that one, I can't recall it changing anything...

@aralroca
Copy link
Owner

aralroca commented Jan 22, 2024

App router example now is working fine with Next.js 14.1.0 after these fixes:

BTW; needs the Next-translate-plugin 3.0.0-canary.1 version

https://github.com/aralroca/next-translate/releases/tag/3.0.0-canary.1

@aralroca aralroca closed this Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants