feat: support nuxt4
๐ Linked issue
#3002
โ Type of change
- [ ] ๐ Documentation (updates to the documentation, readme or JSdoc annotations)
- [ ] ๐ Bug fix (a non-breaking change that fixes an issue)
- [x] ๐ Enhancement (improving an existing functionality like performance)
- [ ] โจ New feature (a non-breaking change that adds functionality)
- [ ] ๐งน Chore (updates to the build process or auxiliary tools and libraries)
- [ ] โ ๏ธ Breaking change (fix or feature that would cause existing functionality to change)
๐ Description
๐ Checklist
- [x] I have linked an issue or discussion.
- [ ] I have added tests (if possible).
- [ ] I have updated the documentation accordingly.
Hmm ๐ค This is strange... rollup v4.18 could not import resources in relative paths... https://github.com/nuxt-modules/i18n/actions/runs/9775263922/job/26985312555#step:11:2032
I've added console.log on unplugin-vue-i18n. I've faced the below log:
resolveId ../../../layers/layer-server/app/locales/en.json5 /path/to/Projects/oss/nuxt/i18n/specs/fixtures/basic_usage/.nuxt/___basic_usage_spec_ts/i18n.options.mjs
resolveId ../../../layers/layer-server/app/locales/en.json5 /path/to/Projects/oss/nuxt/i18n/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@types+no_3dkmkqqbk22rzp2kskenwj4dky/node_modules/nuxt-nightly
I can't understand why en.json5 is importing from nuxt-nightly. ๐
I've added console.log on unplugin-vue-i18n. I've faced the below log:
resolveId ../../../layers/layer-server/app/locales/en.json5 /path/to/Projects/oss/nuxt/i18n/specs/fixtures/basic_usage/.nuxt/___basic_usage_spec_ts/i18n.options.mjs resolveId ../../../layers/layer-server/app/locales/en.json5 /path/to/Projects/oss/nuxt/i18n/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@types+no_3dkmkqqbk22rzp2kskenwj4dky/node_modules/nuxt-nightlyI can't understand why
en.json5is importing fromnuxt-nightly. ๐
This is due to the folder structure changes in Nuxt 4, I have changed the fixture configurations to use the same structure as Nuxt 3 did using the example shown here.
The tests will still fail due to other factors, which should be resolved with https://github.com/nuxt-modules/i18n/pull/3015. I made a branch that's rebased on that PR (and main) to demonstrate here: https://github.com/BobbieGoede/i18n/pull/46.
@kazupon
I have updated/rebased this branch, it looks like it's mostly working except for the nested fixtures.. All fixtures inside specs/fixtures/issues fail with Error: Cannot find module '@nuxtjs/i18n' ๐ค
@kazupon I have updated/rebased this branch, it looks like it's mostly working except for the nested fixtures.. All fixtures inside
specs/fixtures/issuesfail withError: Cannot find module '@nuxtjs/i18n'๐ค
Fixing this required adding the following to pnpm-workspace.yaml:
- 'specs/fixtures/issues/*'
Not sure why or how it previously worked without issue ๐ค but it looks like all tests succeed now ๐ช
@BobbieGoede
Thanks!
Oh, I missed the srcDir change ... ๐คฆโโ๏ธ
The build of the nuxt docs is failing. It seems that nuxt modules that depend on them have not yet been released in a version compatible with nuxt 4.
Closing since these changes are already included in v9