在尝试创建next 3应用程序时出现此错误。我还没有对Axios做任何事情,除了锅炉板代码之外,应用程序基本上是空的。
(base) app % npx nuxi build
Nuxi 3.0.0 14:32:27
Nuxt 3.0.0 with Nitro 1.0.0 14:32:27
ERROR Cannot read properties of undefined (reading 'options') 14:32:28
at axiosModule (node_modules/@nuxtjs/axios/lib/module.js:12:13)
at installModule (node_modules/@nuxt/kit/dist/index.mjs:416:9)
at async initNuxt (node_modules/nuxt/dist/index.mjs:1825:7)
at async loadNuxt (node_modules/nuxt/dist/index.mjs:1857:5)
at async loadNuxt (node_modules/@nuxt/kit/dist/index.mjs:493:19)
at async Object.invoke (node_modules/nuxi/dist/chunks/build.mjs:34:18)
at async _main (node_modules/nuxi/dist/cli.mjs:50:20)
axios模块不再用于Nuxt3,如下所示:https://stackoverflow.com/a/74679190/8816585
直接使用$fetch
,它基本上是对ofetch的包装。
查看模块是否与特定版本的next兼容的快速方法是使用模块页面,例如这里是axios的模块页面。
正如您所看到的,它与Nuxt3不兼容,因为页面是空的。