Skip to content
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

feat: support nuxt4 #3009

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

feat: support nuxt4 #3009

wants to merge 9 commits into from

Conversation

kazupon
Copy link
Collaborator

@kazupon kazupon commented Jul 2, 2024

πŸ”— 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)
  • πŸ‘Œ 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

  • I have linked an issue or discussion.
  • I have added tests (if possible).
  • I have updated the documentation accordingly.

@kazupon
Copy link
Collaborator Author

kazupon commented Jul 3, 2024

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

@kazupon
Copy link
Collaborator Author

kazupon commented Jul 3, 2024

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. πŸ˜…

@BobbieGoede
Copy link
Collaborator

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. πŸ˜…

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 #3015. I made a branch that's rebased on that PR (and main) to demonstrate here: BobbieGoede#46.

@BobbieGoede
Copy link
Collaborator

@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' πŸ€”

@BobbieGoede
Copy link
Collaborator

@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' πŸ€”

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 πŸ’ͺ

@kazupon
Copy link
Collaborator Author

kazupon commented Jul 5, 2024

@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.

src/module.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants