Activities

EThan-Jam

EThan-Jam posted a new question

koa-template •

Module build failed: Error: Plugin/Preset files are not allowed to export objects,

刚按照教程 搭建 了 nuxt ,并 npm i 安装了 依赖项,使用npm run dev 报错了
Module build failed: Error: Plugin/Preset files are not allowed to export objects,

fireairforce

fireairforce posted a new question

koa-template •

Why not update the installation of the framework to solve the question in the begining?

I see many people use this framework meet the same question when they use npm run dev to get this project start,bug they will get some bugs on the installation just like this issue…

so i think if so many people meet the same questions why not update the installation of this framework? :)

fireairforce

fireairforce posted a new question

koa-template •

Why not update the installation of the framework to solve the question in the begining?

I see many people use this framework meet the same question when they use npm run dev to get this project start,bug they will get some bugs on the installation just like this issue

so i think if so many people meet the same questions why not update the installation of this framework? :)

5201314999

5201314999 posted a new question

koa-template •

it's time to update to vue-cli3

I think it is time to update to vue-cli3 and fix some errors now

gotenxds

gotenxds posted a new question

koa-template •

Http2 error for bypassing koa response handling

On line 24 we bypass koa default response handling, this also bypasses logic added in https://github.com/koajs/koa/pull/1264
Which adds support for http2 status handling (removing messages)

ChenDuan

ChenDuan posted a new question

koa-template •

Module build failed: Error: Plugin/Preset files are not allowed to export objects, only functions.

Module build failed: Error: Plugin/Preset files are not allowed to export objects, only functions. In G:\nuxt-learn\nodemodules\backpack-core\babel.js at createDescriptor (G:\nuxt-learn\nodemodules\@babel\core\lib\config\config-descriptors.js:178:11)
at items.map (G:\nuxt-learn\nodemodules\@babel\core\lib\config\config-descriptors.js:109:50) at Array.map (<anonymous>) at createDescriptors (G:\nuxt-learn\nodemodules\@babel\core\lib\config\config-descriptors.js:109:29)
at createPresetDescriptors (G:\nuxt-learn\nodemodules\@babel\core\lib\config\config-descriptors.js:101:10) at passPerPreset (G:\nuxt-learn\nodemodules\@babel\core\lib\config\config-descriptors.js:58:96)
at cachedFunction (G:\nuxt-learn\nodemodules\@babel\core\lib\config\caching.js:33:19) at presets.presets (G:\nuxt-learn\nodemodules\@babel\core\lib\config\config-descriptors.js:29:84)
at mergeChainOpts (G:\nuxt-learn\nodemodules\@babel\core\lib\config\config-chain.js:320:26) at G:\nuxt-learn\nodemodules\@babel\core\lib\config\config-chain.js:283:7

module.js:550
throw err;
^

Error: Cannot find module 'G:\nuxt-learn\build\main.js'
at Function.Module.resolveFilename (module.js:548:15) at Function.Module.load (module.js:475:25)
at Function.Module.runMain (module.js:694:10)
at startup (bootstrapnode.js:204:16) at bootstrapnode.js:625:3

achillesz

achillesz posted a new question

koa-template •

vue init nuxt-community/koa-template nuxt-learn

npm run dev

ERROR Failed to compile with 1 errors 18:43:53

error in ./server/index.js

Module build failed: Error: Plugin/Preset files are not allowed to export objects
, only functions. In /Users/achilles/yilong/nuxt-learn/node_modules/backpack-core
/babel.js

imdunkind

imdunkind posted a new question

koa-template •

Module build failed: Error: Plugin/Preset files are not allowed

`[email protected]:~/NODEJS/testtest$ npm run dev

[email protected] dev /home/imdunkind/NODEJS/testtest
backpack dev

ERROR Failed to compile with 1 errors 11:06:43

error in ./server/index.js

Module build failed: Error: Plugin/Preset files are not allowed to export objects, only functions. In /home/imdunkind/NODEJS/testtest/nodemodules/backpack-core/babel.js at createDescriptor (/home/imdunkind/NODEJS/testtest/nodemodules/@babel/core/lib/config/config-descriptors.js:178:11)
at items.map (/home/imdunkind/NODEJS/testtest/nodemodules/@babel/core/lib/config/config-descriptors.js:109:50) at Array.map (<anonymous>) at createDescriptors (/home/imdunkind/NODEJS/testtest/nodemodules/@babel/core/lib/config/config-descriptors.js:109:29)
at createPresetDescriptors (/home/imdunkind/NODEJS/testtest/nodemodules/@babel/core/lib/config/config-descriptors.js:101:10) at passPerPreset (/home/imdunkind/NODEJS/testtest/nodemodules/@babel/core/lib/config/config-descriptors.js:58:96)
at cachedFunction (/home/imdunkind/NODEJS/testtest/nodemodules/@babel/core/lib/config/caching.js:33:19) at presets.presets (/home/imdunkind/NODEJS/testtest/nodemodules/@babel/core/lib/config/config-descriptors.js:29:84)
at mergeChainOpts (/home/imdunkind/NODEJS/testtest/nodemodules/@babel/core/lib/config/config-chain.js:320:26) at /home/imdunkind/NODEJS/testtest/nodemodules/@babel/core/lib/config/config-chain.js:283:7

internal/modules/cjs/loader.js:605
throw err;
^

Error: Cannot find module '/home/imdunkind/NODEJS/testtest/build/main.js'
at Function.Module.resolveFilename (internal/modules/cjs/loader.js:603:15) at Function.Module.load (internal/modules/cjs/loader.js:529:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:775:12)
at startup (internal/bootstrap/node.js:300:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:826:3)`

package.json
{ "name": "testtest", "version": "1.1.0", "description": "Nuxt.js project", "author": "", "private": true, "scripts": { "dev": "backpack dev", "build": "nuxt build && backpack build", "start": "cross-env NODE_ENV=production node build/main.js", "precommit": "npm run lint", "lint": "eslint --ext .js,.vue --ignore-path .gitignore ." }, "dependencies": { "cross-env": "^5.0.1", "koa": "^2.4.1", "nuxt": "latest", "source-map-support": "^0.4.15" }, "devDependencies": { "babel-eslint": "^7.1.1", "backpack-core": "^0.3.0", "eslint": "^3.13.1", "eslint-loader": "^1.9.0", "eslint-config-standard": "^10.2.1", "eslint-plugin-html": "^2.0.3", "eslint-plugin-import": "^2.2.0", "eslint-plugin-node": "^4.2.2", "eslint-plugin-promise": "^3.4.0", "eslint-plugin-standard": "^3.0.1", "nodemon": "^1.11.0", "scmp": "^2.0.0" } }

freecodemans

freecodemans posted a new question

koa-template •

运行保错

Module build failed (from ./nodemodules/eslint-loader/index.js): TypeError: Cannot read property 'eslint' of undefined at Object.module.exports (E:\vue\nuxt-learn\nodemodules\eslint-loader\index.js:148:18)

You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.

Leesson

Leesson posted a new question

koa-template •

compile error with [email protected]

There is an error when run dev or build:

ERROR in ./.nuxt/client.js
Module build failed (from ./node_modules/eslint-loader/index.js):
TypeError: Cannot read property 'eslint' of undefined
    at Object.module.exports (/Users/didi/Documents/code/test/nuxtKoaTemplate/node_modules/eslint-loader/index.js:148:18)
 @ multi ./.nuxt/client.js app[0]
✖ fatal Nuxt Build Error
Nuxt Fatal Error :(


It is caused by nuxt2.x and can be resolve by updating the dependecies in package.json:

"dependencies": {
   ...
-  "nuxt": "latest",
+  "nuxt": "^1.4.4",
}


Expect to support the latest version

Benleie

Benleie resolved the question #c35

koa-template •

compile error when dev

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

Benleie

Benleie posted a new question

koa-template •

compile error when dev

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.

wen-dong

wen-dong posted a new question

koa-template •

error in ./server/index.js

module build failed: Error: Plugin/Preset files are not allowed to export objects, only function.
In node_modules\backpack-core\babel.js

zgunz42

zgunz42 posted a new question

koa-template •

Failed to Start Dev

After first install the template i got this error

CMD:
yarn dev

OUTPUT

 ERROR  Failed to compile with 1 errors                                                                                                                  11:50:11

 error  in ./server/index.js

Module build failed: Error: Plugin/Preset files are not allowed to export objects, only functions. In /home/ubuntu/workspace/node_modules/backpack-core/babel.js
    at createDescriptor (/home/ubuntu/workspace/node_modules/@babel/core/lib/config/config-descriptors.js:178:11)
    at items.map (/home/ubuntu/workspace/node_modules/@babel/core/lib/config/config-descriptors.js:109:50)
    at Array.map (<anonymous>)
    at createDescriptors (/home/ubuntu/workspace/node_modules/@babel/core/lib/config/config-descriptors.js:109:29)
    at createPresetDescriptors (/home/ubuntu/workspace/node_modules/@babel/core/lib/config/config-descriptors.js:101:10)
    at passPerPreset (/home/ubuntu/workspace/node_modules/@babel/core/lib/config/config-descriptors.js:58:96)
    at cachedFunction (/home/ubuntu/workspace/node_modules/@babel/core/lib/config/caching.js:33:19)
    at presets.presets (/home/ubuntu/workspace/node_modules/@babel/core/lib/config/config-descriptors.js:29:84)
    at mergeChainOpts (/home/ubuntu/workspace/node_modules/@babel/core/lib/config/config-chain.js:315:26)
    at /home/ubuntu/workspace/node_modules/@babel/core/lib/config/config-chain.js:278:7

module.js:549
    throw err;
    ^

Error: Cannot find module '/home/ubuntu/workspace/build/main.js'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3
eugeneCN

eugeneCN posted a new question

koa-template •

babel error

`
cd koa-template
npm install
npm run dev

Module build failed: Error: Plugin/Preset files are not allowed to export objects, only functions. In /Users/eMule/Desktop/koa-template/node_modules/backpack-core/babel.js
`

mrxu0

mrxu0 posted a new question

koa-template •

Production caused the file directory to change using require error
import { resolve } from 'path'
const r = path => resolve(__dirname, path)
require(r('./middlewares/general'))

error

/Users/xuyuechao/Work/other-git-project/nuxt-koa/build/main.js:243
        return !(function webpackMissingModule() { var e = new Error("Cannot find module \".\""); e.code = 'MODULE_NOT_FOUND'; throw e; }());
                                                           ^
Error: Cannot find module "."
    at webpackMissingModule (/Users/xuyuechao/Work/other-git-project/nuxt-koa/build/main.js:243:60)
    at /Users/xuyuechao/Work/other-git-project/nuxt-koa/build/main.js:243:18
    at /Users/xuyuechao/Work/other-git-project/nuxt-koa/node_modules/[email protected]@ramda/src/internal/_pipe.js:3:14
    at /Users/xuyuechao/Work/other-git-project/nuxt-koa/node_modules/[email protected]@ramda/src/internal/_pipe.js:3:27
    at /Users/xuyuechao/Work/other-git-project/nuxt-koa/node_modules/[email protected]@ramda/src/internal/_arity.js:5:45
    at _map (/Users/xuyuechao/Work/other-git-project/nuxt-koa/node_modules/[email protected]@ramda/src/internal/_map.js:6:19)
    at map (/Users/xuyuechao/Work/other-git-project/nuxt-koa/node_modules/[email protected]@ramda/src/map.js:57:14)
    at /Users/xuyuechao/Work/other-git-project/nuxt-koa/node_modules/[email protected]@ramda/src/internal/_dispatchable.js:39:15
    at /Users/xuyuechao/Work/other-git-project/nuxt-koa/node_modules/[email protected]@ramda/src/internal/_curry2.js:20:46
    at f1 (/Users/xuyuechao/Work/other-git-project/nuxt-koa/node_modules/[email protected]@ramda/src/internal/_curry1.js:17:17)
    at new Server (/Users/xuyuechao/Work/other-git-project/nuxt-koa/build/main.js:228:5)
    at Object.<anonymous> (/Users/xuyuechao/Work/other-git-project/nuxt-koa/build/main.js:306:11)
    at Object.<anonymous> (/Users/xuyuechao/Work/other-git-project/nuxt-koa/build/main.js:308:30)
    at __webpack_require__ (/Users/xuyuechao/Work/other-git-project/nuxt-koa/build/main.js:22:30)
    at module.exports.module.exports.head.title (/Users/xuyuechao/Work/other-git-project/nuxt-koa/build/main.js:68:18)
    at Object.<anonymous> (/Users/xuyuechao/Work/other-git-project/nuxt-koa/build/main.js:3:10)

How can I avoid this? The solution I came up with is 1. Change the packing method, and the file directory remains unchanged. 2. Be able to modify these imports into a packaged path。 But don't know how to change webpack

Leesson

Leesson posted a new question

koa-template •

how should I open node debug

I want to debug my scripts on port 3000. And I modified the dev script in package.json with this:

"dev": "backpack dev --inspect-brk=3000"

But it show me an error when i run the script:

listen EADDRINUSE 127.0.0.1:3000

How should i open it? thx.

renoirb

renoirb posted a new question

koa-template •

Document how to also make Koa match Nuxt's router.base

Assuming a project needs to have both Nuxt and Koa to answer to non-root routes, it is unclear how we can make Koa also support setting a baseUrl to something else than root / (e.g. /foo/).

Use case

Ability to support running production build to something else than root /.

// nuxt.config.js
module.exports = {
  router: {
    base: '/foo/'
  }
}

As documented in nuxt.js/…/configuration-router

Issue

Koa has no way of knowing the setting change.

TODO

  1. Setup sample repository (see renoirb/experiments-nuxt-koa-env-runtime-201806, branch rework-hare-20180619 as a starting point)
shalldie

shalldie posted a new bug report

koa-template •

bug compile error when titleTemplate is a function

Version

vue-cli

Reproduction link

https://github.com/shalldie/nuxt-koa-tpl-err

Steps to reproduce

  1. npm install

  2. npm run dev

What is expected ?

compile successfully and the title is ok.

What is actually happening?

compile error when titleTemplagte is a function

Additional comments?

after vue init nuxt-community/koa-template demo and npm intall

in nuxt.config.js, i add this:

  head: {
    title: '',
    titleTemplate: titleChunk => {
      // If undefined or blank then we don't need the hyphen
      return titleChunk ? `${titleChunk} - wqnmlgbd >_<#@!` : 'wqnmlgbd >_<#@!';
    },
  ...

when i try npm run dev, an error appears:

err.png

shalldie

shalldie posted a new question

koa-template •

compile error when titleTemplagte is a function

vue-cli version: 2.9.6

command: vue init nuxt-community/koa-template demo

in nuxt.config.js, i add this:

  head: {
    title: '',
    titleTemplate: titleChunk => {
      // If undefined or blank then we don't need the hyphen
      return titleChunk ? `${titleChunk} - wqnmlgbd >_<#@!` : 'wqnmlgbd >_<#@!';
    },
  ...

when i try npm run dev, an error appears:

image