Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defaultModes error on build with node.js v12 #4014

Closed
AdictoChannel opened this issue May 17, 2019 · 3 comments
Closed

defaultModes error on build with node.js v12 #4014

AdictoChannel opened this issue May 17, 2019 · 3 comments

Comments

@AdictoChannel
Copy link

@viruscamp - I get this error on build
` this.modes = this.plugins.reduce((modes, { apply: { defaultModes }}) => {
^

TypeError: Cannot destructure property defaultModes of 'undefined' or 'null'.
at Service.modes.plugins.reduce (/opt/bluevine/node_modules/@vue/cli-service/lib/Service.js:37:48)
at Array.reduce ()
at new Service (/opt/bluevine/node_modules/@vue/cli-service/lib/Service.js:37:31)
at Object. (/opt/bluevine/node_modules/@vue/cli-service/bin/vue-cli-service.js:16:17)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! deposit_accounts_dashboard@0.1.0 build: vue-cli-service build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the deposit_accounts_dashboard@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /opt/bluevine/.npm/_logs/2019-02-01T02_29_03_707Z-debug.log`

Originally posted by @barakbd-bluevine in #2463 (comment)

For me I got the error by adding a custom vue service plugin in a node.js v12 environment. With node.js v10 it works perfect.

@vue-bot
Copy link

vue-bot commented May 17, 2019

Hello, thank you for taking time filling this issue!

However, we kindly ask you to use our Issue Helper when creating new issues, in order to ensure every issue provides the necessary information for us to investigate. This explains why your issue has been automatically closed by me (your robot friend!).

I hope to see your helper-created issue very soon!

@vue-bot vue-bot closed this as completed May 17, 2019
@abrenneke
Copy link

For anyone that finds this, this is the change in Node v12 that caused this error (for me at least). vue-cli is basically is trying to do require( 'yourScript.js' ) when it should be doing require( './yourScript.js' ).

@vue/cli-service/lib/Service.js line 191:
Before:

plugins = plugins.concat(files.map(file => ({
        id: `local:${file}`,
        apply: loadModule( file, this.pkgContext)
      })))

Fixed:

plugins = plugins.concat(files.map(file => ({
        id: `local:${file}`,
        apply: loadModule(`./${file}`, this.pkgContext)
      })))

sodatea added a commit to sodatea/vue-cli that referenced this issue Jun 3, 2019
sodatea added a commit that referenced this issue Jun 4, 2019
sodatea added a commit that referenced this issue Jun 13, 2019
Thanks to @SneakyMax
See #4014 (comment)

(cherry picked from commit 78e1c4c)
@felloz
Copy link

felloz commented Sep 6, 2020

For anyone that finds this, this is the change in Node v12 that caused this error (for me at least). vue-cli is basically is trying to do require( 'yourScript.js' ) when it should be doing require( './yourScript.js' ).

@vue/cli-service/lib/Service.js line 191:
Before:

plugins = plugins.concat(files.map(file => ({
        id: `local:${file}`,
        apply: loadModule( file, this.pkgContext)
      })))

Fixed:

plugins = plugins.concat(files.map(file => ({
        id: `local:${file}`,
        apply: loadModule(`./${file}`, this.pkgContext)
      })))

Where is the file located in windows?

ZanderOlidan pushed a commit to ZanderOlidan/vue-cli-service-chalkfix that referenced this issue Feb 5, 2024
ZanderOlidan pushed a commit to ZanderOlidan/vue-cli-service-chalkfix that referenced this issue Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants