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

Cannot read property 'toLowerCase' of undefined #21445

Closed
arnaudjnn opened this issue Jan 22, 2021 · 2 comments
Closed

Cannot read property 'toLowerCase' of undefined #21445

arnaudjnn opened this issue Jan 22, 2021 · 2 comments
Labels
bug Issue was opened via the bug report template.

Comments

@arnaudjnn
Copy link

What version of Next.js are you using?

10.0.5

What version of Node.js are you using?

v14.12.0

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying your application?

next dev

Describe the Bug

I'm using Next with i18n-routing.

Here is my next.config.

module.exports = {
  i18n: { 
    locales: ["fr", "en"], 
    defaultLocale: "fr"
  },
}

When I try a slug which contain the specific keywords 'development' I get the following error:

TypeError: Cannot read property 'toLowerCase' of undefined
    at /Users/arnaud/Documents/edflex/node_modules/next/dist/next-server/lib/i18n/normalize-locale-path.js:2:89
    at Array.some (<anonymous>)
    at normalizeLocalePath (/Users/arnaud/Documents/edflex/node_modules/next/dist/next-server/lib/i18n/normalize-locale-path.js:2:55)
    at stripNextDataPath (/Users/arnaud/Documents/edflex/node_modules/next/dist/next-server/server/next-server.js:85:700)
    at DevServer.renderToHTMLWithComponents (/Users/arnaud/Documents/edflex/node_modules/next/dist/next-server/server/next-server.js:87:35)
    at DevServer.renderToHTML (/Users/arnaud/Documents/edflex/node_modules/next/dist/next-server/server/next-server.js:133:934)
    at async DevServer.renderToHTML (/Users/arnaud/Documents/edflex/node_modules/next/dist/server/next-dev-server.js:34:578)
    at async DevServer.render (/Users/arnaud/Documents/edflex/node_modules/next/dist/next-server/server/next-server.js:72:236)
    at async Object.fn (/Users/arnaud/Documents/edflex/node_modules/next/dist/next-server/server/next-server.js:47:704)
    at async Router.execute (/Users/arnaud/Documents/edflex/node_modules/next/dist/next-server/server/router.js:23:67)
    at async DevServer.run (/Users/arnaud/Documents/edflex/node_modules/next/dist/next-server/server/next-server.js:66:1042)
    at async DevServer.handleRequest (/Users/arnaud/Documents/edflex/node_modules/next/dist/next-server/server/next-server.js:34:1081)

Expected Behavior

I need to use a slug with the keyword development inside.

To Reproduce

Start the app with next dev and try the other locale than the default white the keyword development inside the slug

@arnaudjnn arnaudjnn added the bug Issue was opened via the bug report template. label Jan 22, 2021
@ijjk
Copy link
Member

ijjk commented Jan 22, 2021

Hi, this was already fixed in #19901 which is available in the latest canary of Next.js v10.0.6-canary.7, please update and give it a try!

@ijjk ijjk closed this as completed Jan 22, 2021
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

3 participants