0

我正在使用 Vue 和 Nuxtjs 开发一个简单的项目。我从 yarn dev 开始,但是当生成 nuxt 文件时,我收到一个友好的错误,内容如下:

错误信息

所以我检查了 .nuxt 目录,我的文件的导入有错误的语法:

const _16d0ac86 = () => interopDefault(import('..\\pages\\index.vue' /* webpackChunkName: "pages/index" */))

所以导入有一个反斜杠“\”而不是一个常规的“/”。这显然是错误的,但我不知道是什么触发了它,它昨天正常工作。我删除了我今天所做的更改,这仍然发生。

我已经删除了我的node_modules目录并重新安装了所有依赖项,我还删除了我的 nuxt 文件并重建它。希望你能帮忙!这是我的nuxt.config.js文件

  // Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
  ssr: false,

  // Global page headers: https://go.nuxtjs.dev/config-head
  head: {
    title: 'giftshop-nuxtjs',
    htmlAttrs: {
      lang: 'en',
    },
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: '' },
      { name: 'format-detection', content: 'telephone=no' },
    ],
    link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
  },

  // Global CSS: https://go.nuxtjs.dev/config-css
  css: [],

  // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
  plugins: [],

  // Auto import components: https://go.nuxtjs.dev/config-components
  components: true,
  generate: {
    // choose to suit your project
    interval: 2000,
  },

  // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
  buildModules: [
    // https://go.nuxtjs.dev/typescript
    '@nuxt/typescript-build',
    // https://go.nuxtjs.dev/tailwindcss
    '@nuxtjs/tailwindcss',

    '@nuxtjs/composition-api/module',
  ],

  // Modules: https://go.nuxtjs.dev/config-modules
  modules: [
    // https://go.nuxtjs.dev/axios
    '@nuxtjs/axios',
    'vue-toastification/nuxt',
  ],

  // Axios module configuration: https://go.nuxtjs.dev/config-axios
  axios: {
    baseURL: 'http://localhost:3002',
  },

  // Build Configuration: https://go.nuxtjs.dev/config-build
  build: {},
}```
4

0 回答 0