compile error when dev

Benleie
10
Benleie
commented 3 months ago

After installation,when npm run dev
Error: Plugin/Preset files are not allowed to export objects, only functions.
image

And i updated backpack-core to 0.7.0, but this error still exists.

0
Benleie
10
Benleie
commented 3 months ago

so i have to use nuxt@1.4.x to fix it

0
you06
0
you06
commented 3 months ago

Issue occurs due to:

  • no babel-loader(node.js itself does not support es6 import)
  • outdated dependencies

My solution:
install babel-loader, upgrade eslint-loader

yarn remove eslint-loader
yarn add -D eslint-loader babel-loader

edit backpack.config.js

module.exports = {
  webpack: (config, options, webpack) => {
    config.entry.main = './server/index.js'
    config.module = {
      rules: [
        {
          test: /\.js$/,
          loader: "babel-loader",
          exclude: /(node_modules)/
        }
      ]
    }
    return config
  }
}

I've open a pull request fix this issue, just try vue init you06/koa-template <project-name> before merge accepted.

0
Informations
QuestionResolved
#c35 - Created 3 months ago