nuxt-community / koa-template

Starter template for Nuxt.js with KoaJS.
https://koa.nuxtjs.org
382 stars 62 forks source link

compile error when dev #52

Closed Benleie closed 6 years ago

Benleie commented 6 years 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.

This question is available on Nuxt community (#c35)
ghost commented 6 years ago

This issue as been imported as question since it does not respect koa-template issue template. Only bug reports and feature requests stays open to reduce maintainers workload. If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically. Your question is available at https://cmty.app/nuxt/koa-template/issues/c35.

Benleie commented 6 years ago

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

ghost commented 6 years ago

This question has been resolved by @Benleie, see answer.

you06 commented 6 years ago

Issue occurs due to:

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.