Open SGDS-SyL opened 1 year ago
Would you be able to provide a reproduction? π
Thank you for opening an issue.
Just to inform as written in the discussion:
"@nuxtjs/i18n": "8.0.0-beta.4"
solves the installation error (every newer version breaks) but with that version all translations in the layer need to move to the application.
I would like to look into this issue but I will need a minimal reproduction to debug the exact issue. π
Nuxt 3.8.0
has layer improvements which may tackle the underlying issue here.
i18n-app
npm install
Install should fail
"@skoenfeld/i18n-layer": "0.0.2"
"@nuxtjs/i18n": "^8.0.0-rc.5"
dependencyNote: Both, Layer and App do not have any configuration in their nuxt.config.ts, because the issue is in the installation of the layer. You should observe this error:
npm ERR! ERROR No lockfile found from ...\i18n-reproduction\i18n-app\node_modules\@skoenfeld\i18n-layer
npm ERR!
npm ERR! at resolveLockfile (.../i18n-reproduction/i18n-app/node_modules/pkg-types/dist/index.mjs:122:9)
npm ERR! at async getPackageManagerType (.../i18n-reproduction/i18n-app/node_modules/@nuxtjs/i18n/dist/module.mjs:108:26)
its my first reproduction, feel free to improve me via critics ^^
@derHodrig
I believe the issue you're experiencing is because the layer runs nuxt prepare
because of the npm postinstall
script, but lockfiles are not published in npm packages. Can you try removing the postinstall
script and check if it works again? And of course I recommend installing the edge release channel as it includes most recent bug fixes!
its my first reproduction, feel free to improve me via critics ^^
It's a good reproduction! As it is an npm package it is a bit hard to make changes and test, but that's something inherent to this specific issue π
@BobbieGoede did not think that this problem is that simple solved.
@SGDS-SyL could you please rename your postinstall
script in your layer>package.json and install the new published layer?
https://github.com/derHodrig/nuxt-i18n-reproduction/commit/4c88663f56c81028919cd83580be86a9fdbfce4e#diff-b68b7af82dbabeceff18a29ef8697de0c088349cd1b2a4f0a872ec92095c7802
In my case, in the reproduction, the issue was solved.
Downturn is, after your install deps in the layer, you have to manually use the nuxt prepare .playground
In my case, in the reproduction, the issue was solved.
Glad to hear the issue was solved for you!
Downturn is, after your install deps in the layer, you have to manually use the nuxt prepare .playground
Hmm, have you tried updating the module to the latest edge release and seeing if the error is still thrown when keeping the postinstall
script?
npm ERR! at async getPackageManagerType (.../i18n-reproduction/i18n-app/node_modules/@nuxtjs/i18n/dist/module.mjs:108:26)
I believe the code that is throwing this error has been removed and is not present in the edge release.
Running into the same issue as discussion, Layer works locally but when changed to Github repo. It failed with this:
Failed to resolve import "/lang/en.json" from ".nuxt\i18n.options.mjs"
I've checked and the file do exist.Discussed in https://github.com/nuxt-modules/i18n/discussions/2388