atinux / nuxt-auth-utils

Add Authentication to Nuxt applications with secured & sealed cookies sessions.
MIT License
981 stars 91 forks source link

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

Closed wuiyang closed 3 months ago

wuiyang commented 5 months 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 5 months 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?