Skip to content

Could not resolve import "#app" #242

@trandaison

Description

@trandaison

I created a module https://github.com/trandaison/nuxt-3-auth, the playground is working perfectly.
However, when I run npm run prepack, I got this error

(node-resolve plugin) Could not resolve import "#app" in /nuxt-3-auth/src/runtime/services/AuthStorage.ts using imports defined in /nuxt-3-auth/package.json.
(node-resolve plugin) Could not resolve import "#app" in /nuxt-3-auth/src/runtime/services/AuthStorage.ts using imports defined in /nuxt-3-auth/package.json.
"#app" is imported by "src/runtime/services/AuthStorage.ts", but could not be resolved – treating it as an external dependency.

 WARN  Build is done with some warnings:
- Inlined implicit external #app

 ERROR  Exiting with code (1). You can change this behavior by setting failOnWarn: false . 

Screenshot 2024-03-19 at 11 17 13

Since AuthStorage.ts is not using any import from #app anymore, I don't know why it still throws this error.

=====

  • Operating System: Darwin
  • Node Version: v18.16.0
  • Nuxt Version: 3.8.2
  • CLI Version: 3.9.1
  • Nitro Version: 2.8.1
  • Package Manager: [email protected]
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions