-
-
Notifications
You must be signed in to change notification settings - Fork 483
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 even build project anymore: Cannot read property 'startsWith' of undefined #1101
Comments
Can you post your nuxt-i18n configuration (with anything sensitive redacted out)? |
Locales end up being this:
|
It seems it's because one of files is undefined. |
Yes. That's the reason. There is a slight change of behavior in recent changes. Previously it would not hard crash at build time but would throw an error anyway:
And when running in dev mode you would also see an error overlay over the page. So I'm not sure how it has worked before for you. |
So how will this be handled? Nicer error message but still error? |
I would prefer to just do what we do now and crash at build time when If I decide to just ignore such problem then instead there will be a warning at runtime when attempting to load the language that doesn't exist. Ideally, the You can just assign the English locale file if you don't have a language file for a specific locale. |
But improving the error message is also something that can be done of course. |
I probably did read that file is required, but in my own development didn't account for the fact that it could be undefined somehow – it slipped. It's not a problem to handle it on package user's end, but improving the error message for something that is explicitly stated in docs would probably go a long way to reduce headaches. ¯\_(ツ)_/¯ |
Improved various error cases in #1102 |
Version
nuxt-i18n: 6.20.6
nuxt: 2.15.2
Could not compile template D:\Dokumenti\vue\gauss-web-new\node_modules\nuxt-i18n\src\templates\options.js: Cannot read property 'startsWith' of undefined 13:50:30
at node_modules@nuxt\builder\dist\builder.js:723:17
at async Promise.all (index 431)
at async Builder.compileTemplates (node_modules@nuxt\builder\dist\builder.js:701:5)
at async Builder.generateRoutesAndFiles (node_modules@nuxt\builder\dist\builder.js:388:5)
at async Builder.build (node_modules@nuxt\builder\dist\builder.js:319:5)
at async Object._buildDev (node_modules@nuxt\cli\dist\cli-dev.js:107:5)
at async Object.startDev (node_modules@nuxt\cli\dist\cli-dev.js:65:7)
at async Object.run (node_modules@nuxt\cli\dist\cli-dev.js:52:5)
at async NuxtCommand.run (node_modules@nuxt\cli\dist\cli-index.js:413:7)
I'm sorry, I don't have time or can be bothered to do all the detailed reporting and reproduction. Nothing changed on my side, it just stopped working after update. (Not sure which version was used before that).
The text was updated successfully, but these errors were encountered: