指尖上的记忆指尖上的记忆
首页
  • 基础
  • Laravel框架
  • Symfony框架
  • 基础
  • Gin框架
  • 基础
  • Spring框架
  • 命令
  • Nginx
  • Ai
  • Deploy
  • Docker
  • K8s
  • Micro
  • RabbitMQ
  • Mysql
  • PostgreSsql
  • Redis
  • MongoDb
  • Html
  • Js
  • 前端
  • 后端
  • Git
  • 知识扫盲
  • Golang
🌟 gitHub
首页
  • 基础
  • Laravel框架
  • Symfony框架
  • 基础
  • Gin框架
  • 基础
  • Spring框架
  • 命令
  • Nginx
  • Ai
  • Deploy
  • Docker
  • K8s
  • Micro
  • RabbitMQ
  • Mysql
  • PostgreSsql
  • Redis
  • MongoDb
  • Html
  • Js
  • 前端
  • 后端
  • Git
  • 知识扫盲
  • Golang
🌟 gitHub

nuxt3引用报错解决办法:

1.执行
$ npx nuxi dev
报错:
✘ [ERROR] Could not resolve "#build/app.config.mjs"

    node_modules/nuxt/dist/app/config.mjs:3:24:
      3 │ import __appConfig from "#build/app.config.mjs";
        ╵                         ~~~~~~~~~~~~~~~~~~~~~~~

  The package import "#build/app.config.mjs" is not defined in this "imports" map:

    node_modules/nuxt/package.json:23:13:
      23 │   "imports": {
         ╵              ^

  You can mark the path "#build/app.config.mjs" as external to exclude it from the bundle, which
  will remove this error.

原因:
在我的utils/utils.js下引入了nuxt/app
import {useCookie} from "nuxt/app";

解决办法:
import {useCookie} from "#imports";

这样再次执行就不会报错了,不明白为什么