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

refactor: import defineNitroPlugin from #imports instead of nitropack/runtime #2787

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ejfox
Copy link

@ejfox ejfox commented Sep 18, 2024

This is my first PR- but this bug has been bugging me for a few weeks now, and I'm not sure if I have some unique setup that causes the error, but this is blocking me from doing pretty much anything- so I figured I'd give it a shot!

I am not sure the best way to go about testing this- but I am essentially cargo-culting the solution from nuxt/icon and hoping this can be solved in the same way- let me know how to best support/test/finish this off and I will do my best

🔗 Linked issue

MIGHT SOLVE #2736

Related:

❓ Type of change

I tried the mirror the changes from nuxt/icon in this commit: https://github.com/nuxt/icon/pull/249/files

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 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)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

In the previous version, defineNitroPlugin was imported from nitropack/runtime - this instead uses #imports

Currently when running yarn dev with latest Nuxt / Nuxt Content, I get this:

[10:37:10 AM]  ERROR  [worker reload] [worker init] Package import specifier "#internal/nitro/virtual/plugins" is not defined in package /Users/ejfox/code/website/node_modules/nitropack/package.json imported from /Users/ejfox/code/website/node_modules/nitropack/dist/runtime/app.mjs

  at __node_internal_captureLargerStackTrace (node:internal/errors:496:5)
  at new NodeError (node:internal/errors:405:5)
  at importNotDefined (node:internal/modules/esm/resolve:348:10)
  at packageImportsResolve (node:internal/modules/esm/resolve:775:9)
  at moduleResolve (node:internal/modules/esm/resolve:930:16)
  at defaultResolve (node:internal/modules/esm/resolve:1129:11)
  at nextResolve (node:internal/modules/esm/loader:163:28)
  at ESMLoader.resolve (node:internal/modules/esm/loader:835:30)
  at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
  at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40)
  at link (node:internal/modules/esm/module_job:76:36)

which prevents both publishing and development

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

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.

1 participant