sidebase / nuxt-auth

Authentication built for Nuxt 3! Easily add authentication via OAuth providers, credentials or Email Magic URLs!
https://auth.sidebase.io
MIT License
1.31k stars 164 forks source link

Error starting the project after installation #748

Closed rbrt457 closed 5 months ago

rbrt457 commented 6 months ago

Environment

Reproduction

No response

Describe the bug

The error "Cannot find package 'next-auth' imported from D:\sidebase-p.nuxt\dev\index.mjs" is reproduced immediately after installing the Merino Stack. It is strange that the error appears immediately after installing the stack. All dependencies are installed.

image image

Additional context

No response

Logs

WARN  "next-auth/providers/github" is imported by "server/api/auth/[...].ts", but could not be resolved – treating it as an external dependency.                             00:30:25  

 WARN  "next-auth/providers/credentials" is imported by "server/api/auth/[...].ts", but could not be resolved – treating it as an external dependency.                        00:30:25  

[00:30:25]  WARN  "next-auth/core" is imported by "node_modules/@sidebase/nuxt-auth/dist/runtime/server/services/authjs/nuxtAuthHandler.mjs", but could not be resolved – treating it as an external dependency.

[00:30:25]  WARN  "next-auth/jwt" is imported by "node_modules/@sidebase/nuxt-auth/dist/runtime/server/services/authjs/nuxtAuthHandler.mjs", but could not be resolved – treating it as an external dependency.

✔ Nuxt Nitro server built in 1407 ms                                                                                                                                   nitro 00:30:25

 ERROR  [worker reload] [worker init] Cannot find package 'next-auth' imported from D:\sidebase-p\.nuxt\dev\index.mjs                                                         00:30:25  

  at packageResolve (node:internal/modules/esm/resolve:853:9)
  at moduleResolve (node:internal/modules/esm/resolve:910:20)
  at defaultResolve (node:internal/modules/esm/resolve:1130:11)
  at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:396:12)
  at ModuleLoader.resolve (node:internal/modules/esm/loader:365:25)
  at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38)
  at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:39)
  at link (node:internal/modules/esm/module_job:84:36)
phoenix-ru commented 6 months ago

Have you added next-auth as a dependency? https://sidebase.io/nuxt-auth/getting-started/installation#specifics-authjs-provider

github-actions[bot] commented 6 months ago

Hello 👋

Please provide a reproduction for this issue 🙏

How can I create a reproduction? Please use one of the following links to reproduce your issue. - https://stackblitz.com/github/nuxt/starter/tree/v3-stackblitz - https://codesandbox.io/s/github/nuxt/starter/v3-codesandbox Please ensure that the reproduction is as **minimal** as possible. This will allow us to isolate the issue as best as possible. Here are some more amazing posts about the importance of reproductions: - [The Importance of Reproductions](https://antfu.me/posts/why-reproductions-are-required) - [How to Generate a Minimal, Complete, and Verifiable Example](https://stackoverflow.com/help/minimal-reproducible-example)
github-actions[bot] commented 5 months ago

This issue was closed because it was open for 14 days without a reproduction.