question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

localeSubpaths generate TypeError in force-trailing-slash.js

See original GitHub issue

I just try to run the source example with localeSubpaths set to true

Here is my i18n.js (only change made)

const NextI18Next = require('next-i18next')

module.exports = new NextI18Next({
	otherLanguages: ['de'],
	localeSubpaths: true
})

And then, each page load result in lots of warning in the shell

TypeError: Cannot read property 'options' of undefined
    at _default (...\node_modules\next-i18next\dist\utils\force-trailing-slash.js:15:12)

— (the full trace is too long and not really usefull) —

Page generation still work and translation are in place, but kinda worry about all those warnings about a missing i18n object

https://github.com/isaachinman/next-i18next/blob/master/src/utils/force-trailing-slash.js (line 5)

req.i18n.options.allLanguages.forEach((lng) => {

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
isaachinmancommented, Dec 24, 2018

That’s not an additional problem, that’s the same problem. Fix coming shortly.

0reactions
isaachinmancommented, Jan 3, 2019

Basic e2e testing added with 08b0449.

Read more comments on GitHub >

github_iconTop Results From Across the Web

localeSubpaths generate TypeError in force-trailing-slash.js
I just try to run the source example with localeSubpaths set to true Here is my i18n.js (only change made) const NextI18Next =...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found