-
-
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
Absolute langDir
path isn't validated/resolved correctly
#1913
Comments
For reference: Line 67 in 029c634
|
@BobbieGoede in this case p.resolve('/path/to/project', '/locales') === '/locales' But in dev mode and during |
I think that's the issue, as the following is what happens when passing a relative path. p.resolve('/path/to/project', 'locales') === '/path/to/project/locales'
p.resolve('/path/to/project', './locales') === '/path/to/project/locales' I'm not sure why it does work in dev mode however. |
Probably the issue is that Lines 145 to 148 in 029c634
which is "resolved" inside by Lines 171 to 173 in 029c634
|
Environment
https://stackblitz.com/edit/github-wfnczp-7tzsju?file=nuxt.config.ts
Reproduction
a. Dev mode
✔ The page contains
b. Build
Open preview page with disabled JS
❌ The page contains
It indicates that the translations were not loaded at all
c. Generate
❌ The page contains:
Translations are loaded at
generate
, but interpolation doesn't work correctlyDescribe the bug
First of all, at build stage
langDir: '/locales'
is accepted. Looks like it isn't recognized as an absolute path because somewherejoin
is used instead ofresolve
.When I specify
resolve('locales')
, it throws an errorCould not resolve "../home/username/i18n-interpolation-issue/locales/en.json" from ".nuxt/i18n.options.mjs"
Additional context
The most confusing things are"
npm run generate
, but not message with interpolation.npm run dev
)Logs
No response
The text was updated successfully, but these errors were encountered: