Atinux / nuxt-auth-utils

Minimal Auth module for Nuxt 3.
MIT License
605 stars 58 forks source link

[plugin node-resolve] Could not resolve import "nitropack/runtime" #98

Open wuiyang opened 3 weeks ago

wuiyang commented 3 weeks ago

After I have installed Nuxt Auth Utils, I am unable to do npm run dev as it would gives me an error.

[plugin node-resolve] Could not resolve import "nitropack/runtime" in [project-path]/node_modules/@nuxthub/core/dist/runtime/ready.dev.js using exports defined in [project-path]/node_modules/nitropack/package.json.

Upon checking, it was caused by this code https://github.com/Atinux/nuxt-auth-utils/blob/c323edc75d10af8f7481df81ff4f7c54622192d0/src/runtime/server/plugins/oauth.ts#L2

I'm using nitropack@2.9.4 in the project.

They suggested to use import from '#imports', but that would caused an issue for module developer to target imports: false user. They updated the code to allow direct import from nitropack/runtime at v2.9.5 at this commit

However, based on https://github.com/unjs/nitro/pull/2314 pull request, it seems like it would be a temporary fix rather than actual implementation. It might be good to put a reminder that this import might not work in the future.

Is it possible to update documentation website about the import error and suggest to update nitropack to v2.9.5 or higher?

Atinux commented 3 weeks ago

Sorry about this @wuiyang

Is it possible to update documentation website about the import error and suggest to update nitropack to v2.9.5 or higher?

Do you mean in the readme? If so, are you happy to open a PR?