react-native 0.57.1 bundle fails trying to assign a value to read only property 'undefined' - node.js

When releasing a CodePush release, I am running into this issue.
$ appcenter codepush release-react \
--deployment-name=Staging \
--token=$APPCENTER_ACCESS_TOKEN \
--description "$(git show -q)" \
--disable-duplicate-release-error \
--app=$APP_NAME
| Getting app info.../ Getting app info...- Getting app info...\ Getting app info...| Getting app info...Detecting android app version:
Using the target binary version value "0.0.1" from "android/app/build.gradle".
Running "react-native bundle" command:
node node_modules/react-native/local-cli/cli.js bundle --assets-dest /tmp/code-push11899-237-hv244s.pd3u/CodePush --bundle-output /tmp/code-push11899-237-hv244s.pd3u/CodePush/index.android.bundle --dev false --entry-file index.js --platform android
Cannot assign to read only property 'undefined' of object '#<Object>'
TypeError: Cannot assign to read only property 'undefined' of object '#<Object>'
at buildBundle$ (/home/circleci/repo/node_modules/react-native/local-cli/bundle/buildBundle.js:39:10)
at tryCatch (/home/circleci/repo/node_modules/regenerator-runtime/runtime.js:62:40)
at Generator.invoke [as _invoke] (/home/circleci/repo/node_modules/regenerator-runtime/runtime.js:288:22)
at Generator.prototype.(anonymous function) [as next] (/home/circleci/repo/node_modules/regenerator-runtime/runtime.js:114:21)
at tryCatch (/home/circleci/repo/node_modules/regenerator-runtime/runtime.js:62:40)
at invoke (/home/circleci/repo/node_modules/regenerator-runtime/runtime.js:152:20)
at /home/circleci/repo/node_modules/regenerator-runtime/runtime.js:187:11
at new Promise (<anonymous>)
at callInvokeWithMethodAndArg (/home/circleci/repo/node_modules/regenerator-runtime/runtime.js:186:16)
at AsyncIterator.enqueue [as _invoke] (/home/circleci/repo/node_modules/regenerator-runtime/runtime.js:209:13)
Error: Failed to release a CodePush update.
Exited with code 3
I have explored a bit, but the mentioned line seems to point to https://github.com/facebook/react-native/blob/master/local-cli/bundle/buildBundle.js#L39 which is a simple NODE_ENV overwrite:
process.env.NODE_ENV = args.dev ? 'development' : 'production';
Do you have any idea where that issue is coming from?
Here is more information:
node:8.10
yarn install v1.5.1
appcenter-cli#1.1.4
"react-native": "0.57.1",
"react-native-code-push": "^5.4.0",
Update
I have narrowed it down to the following command failing:
./node_modules/.bin/react-native bundle --platform android --dev false --reset-cache --entry-file index.js --bundle-output ./android/app/build/generated/assets/react/release/index.android.bundle --assets-dest ./android/app/build/generated/res/react/release
Cannot assign to read only property 'undefined' of object '#<Object>'
TypeError: Cannot assign to read only property 'undefined' of object '#<Object>'
at buildBundle$ (/Users/chanto/Apps/mobile-app/node_modules/react-native/local-cli/bundle/buildBundle.js:39:10)
at tryCatch (/Users/chanto/Apps/mobile-app/node_modules/regenerator-runtime/runtime.js:62:40)
at Generator.invoke [as _invoke] (/Users/chanto/Apps/mobile-app/node_modules/regenerator-runtime/runtime.js:288:22)
at Generator.prototype.(anonymous function) [as next] (/Users/chanto/Apps/mobile-app/node_modules/regenerator-runtime/runtime.js:114:21)
at tryCatch (/Users/chanto/Apps/mobile-app/node_modules/regenerator-runtime/runtime.js:62:40)
at invoke (/Users/chanto/Apps/mobile-app/node_modules/regenerator-runtime/runtime.js:152:20)
at /Users/chanto/Apps/mobile-app/node_modules/regenerator-runtime/runtime.js:187:11
at new Promise (<anonymous>)
at callInvokeWithMethodAndArg (/Users/chanto/Apps/mobile-app/node_modules/regenerator-runtime/runtime.js:186:16)
at AsyncIterator.enqueue [as _invoke] (/Users/chanto/Apps/mobile-app/node_modules/regenerator-runtime/runtime.js:209:13)

Upgrading to react-native 0.57.2 solved my issue.
#wonderfulbump

Related

ERROR when compile using Nodejs webpack compile:scss error

i have the following error when run this npm run compile:js i get this error:
> sfra#6.0.0 compile:scss
> sgmf-scripts --compile css
C:\Users\Administrator\Desktop\NewTry\trainingb2c\node_modules\webpack\lib\ChunkGraph.js:1679
throw new Error(
^
Error: Chunk.getNumberOfModulesThere was no ChunkGraph assigned to the Chunk for backward-compat (Use the new API)
at deprecated (node:internal/util:89:15)
at Function.getChunkGraphForChunk (C:\Users\Administrator\Desktop\NewTry\trainingb2c\node_modules\webpack\lib\ChunkGraph.js:1689:10)
at Chunk.getNumberOfModules (C:\Users\Administrator\Desktop\NewTry\trainingb2c\node_modules\webpack\lib\Chunk.js:170:21)
at ExtractTextPlugin.<anonymous> (C:\Users\Administrator\Desktop\NewTry\trainingb2c\node_modules\extract-text-webpack-plugin\dist\index.js:302:30)
at Array.forEach (<anonymous>)
at C:\Users\Administrator\Desktop\NewTry\trainingb2c\node_modules\extract-text-webpack-plugin\dist\index.js:301:25
at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Users\Administrator\Desktop\NewTry\trainingb2c\node_modules\sgmf-scripts\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:7:1)
at AsyncSeriesHook.lazyCompileHook (C:\Users\Administrator\Desktop\NewTry\trainingb2c\node_modules\sgmf-scripts\node_modules\tapable\lib\Hook.js:154:20)
at C:\Users\Administrator\Desktop\NewTry\trainingb2c\node_modules\sgmf-scripts\node_modules\webpack\lib\Compilation.js:1405:32
this is my webpack.config.js:
webpack.config.js
Some idea to solve? thanks in advance

JHipster 7.0.1 Generating Application from Blueprint Error

I am getting below error when trying to use a locally-linked blueprint. The command I run is also below. Please advise.
Environment:
node --version -> v14.17.0
npm --version -> 6.14.13
jhipster --version -> 7.0.1
yo --version -> 3.1.1
Command I run:
jhipster import-jdl apps.jh --blueprints cassandra-blueprint
Error I get from above command:
ERROR! jhContext.setupServerOptions is not a function
TypeError: jhContext.setupServerOptions is not a function
at new module.exports (/Users/amarppatel/workspace/saathratri-app-holder/jhipster-cassandra-blueprint/generators/common/index.js:20:19)
at Environment.instantiate (/usr/local/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/lib/environment.js:748:23)
at Environment.create (/usr/local/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/lib/environment.js:720:17)
at JHipsterCommonGenerator.composeWith (/usr/local/lib/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/index.js:1182:42)
at JHipsterCommonGenerator._composeBlueprint (/usr/local/lib/node_modules/generator-jhipster/generators/generator-base-blueprint.js:348:37)
at /usr/local/lib/node_modules/generator-jhipster/generators/generator-base-blueprint.js:248:41
at Array.forEach (<anonymous>)
at JHipsterCommonGenerator.instantiateBlueprints (/usr/local/lib/node_modules/generator-jhipster/generators/generator-base-blueprint.js:247:18)
at new JHipsterCommonGenerator (/usr/local/lib/node_modules/generator-jhipster/generators/common/index.js:41:49)
at Environment.instantiate (/usr/local/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/lib/environment.js:748:23)
ERROR! jhContext.setupServerOptions is not a function
TypeError: jhContext.setupServerOptions is not a function
at new module.exports (/Users/amarppatel/workspace/saathratri-app-holder/jhipster-cassandra-blueprint/generators/common/index.js:20:19)
at Environment.instantiate (/usr/local/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/lib/environment.js:748:23)
at Environment.create (/usr/local/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/lib/environment.js:720:17)
at JHipsterCommonGenerator.composeWith (/usr/local/lib/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/index.js:1182:42)
at JHipsterCommonGenerator._composeBlueprint (/usr/local/lib/node_modules/generator-jhipster/generators/generator-base-blueprint.js:348:37)
at /usr/local/lib/node_modules/generator-jhipster/generators/generator-base-blueprint.js:248:41
at Array.forEach (<anonymous>)
at JHipsterCommonGenerator.instantiateBlueprints (/usr/local/lib/node_modules/generator-jhipster/generators/generator-base-blueprint.js:247:18)
at new JHipsterCommonGenerator (/usr/local/lib/node_modules/generator-jhipster/generators/common/index.js:41:49)
at Environment.instantiate (/usr/local/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/lib/environment.js:748:23)
INFO! Generator app child process exited with code 1
ERROR! Error executing app --reproducible --no-force --with-entities --no-dry-run --no-whitespace --no-bail --no-skip-regenerate --no-skip-yo-resolve --from-jdl --blueprints cassandra-blueprint --no-skip-cache --no-skip-install --no-force-install --no-ask-answered --no-defaults --no-skip-git
Error: Error executing app --reproducible --no-force --with-entities --no-dry-run --no-whitespace --no-bail --no-skip-regenerate --no-skip-yo-resolve --from-jdl --blueprints cassandra-blueprint --no-skip-cache --no-skip-install --no-force-install --no-ask-answered --no-defaults --no-skip-git
at ChildProcess.<anonymous> (/usr/local/lib/node_modules/generator-jhipster/cli/import-jdl.js:183:16)
at ChildProcess.emit (events.js:376:20)
at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
ERROR! jhContext.setupServerOptions is not a function
INFO! Generator app child process exited with code 1
TypeError: jhContext.setupServerOptions is not a function
at new module.exports (/Users/amarppatel/workspace/saathratri-app-holder/jhipster-cassandra-blueprint/generators/common/index.js:20:19)
at Environment.instantiate (/usr/local/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/lib/environment.js:748:23)
at Environment.create (/usr/local/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/lib/environment.js:720:17)
at JHipsterCommonGenerator.composeWith (/usr/local/lib/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/index.js:1182:42)
at JHipsterCommonGenerator._composeBlueprint (/usr/local/lib/node_modules/generator-jhipster/generators/generator-base-blueprint.js:348:37)
at /usr/local/lib/node_modules/generator-jhipster/generators/generator-base-blueprint.js:248:41
at Array.forEach (<anonymous>)
at JHipsterCommonGenerator.instantiateBlueprints (/usr/local/lib/node_modules/generator-jhipster/generators/generator-base-blueprint.js:247:18)
at new JHipsterCommonGenerator (/usr/local/lib/node_modules/generator-jhipster/generators/common/index.js:41:49)
at Environment.instantiate (/usr/local/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/lib/environment.js:748:23)
INFO! Generator app child process exited with code 1

Mocha not working in WebStorm in WSL due to 'unknown \"reporter\"'

When running mocha in WebSstorm pointed to a WSL environment I get:
C:\Users\iursino\AppData\Local\Microsoft\WindowsApps\ubuntu.exe run "export PATH=/home/iursino/n/bin:$PATH && /home/iursino/n/bin/node --inspect-brk=49953 /mnt/c/workspace/redacted-project-name/node_modules/mocha/bin/_mocha --timeout 0 --ui bdd --reporter \"/mnt/c/Program Files/JetBrains/WebStorm 2019.2.4/plugins/NodeJS/js/mocha-intellij/lib/mochaIntellijReporter.js\" /mnt/c/workspace/redacted-project-name/src/Filename.spec.ts --grep \"^invoke lambda Expect error if lambda returns an error$\""
Debugger listening on ws://127.0.0.1:49953/f31007fa-106c-4847-94cf-3e7d98d72e71
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
mocha debug [spec..]
Run tests with Mocha
Rules & Behavior
--allow-uncaught Allow uncaught errors to propagate [boolean]
--async-only, -A Require all tests to use a callback (async) or
return a Promise [boolean]
--bail, -b Abort ("bail") after first test failure [boolean]
--check-leaks Check for global variable leaks [boolean]
--delay Delay initial execution of root suite [boolean]
--exit Force Mocha to quit after tests complete [boolean]
--forbid-only Fail if exclusive test(s) encountered [boolean]
--forbid-pending Fail if pending test(s) encountered [boolean]
--global, --globals List of allowed global variables [array]
--retries Retry failed tests this many times [number]
--slow, -s Specify "slow" test threshold (in milliseconds)
[number] [default: 75]
--timeout, -t, --timeouts Specify test timeout threshold (in milliseconds)
[number] [default: 2000]
--ui, -u Specify user interface [string] [default: "bdd"]
Reporting & Output
--color, -c, --colors Force-enable color output [boolean]
--diff Show diff on failure
[boolean] [default: true]
--full-trace Display full stack traces [boolean]
--growl, -G Enable Growl notifications [boolean]
--inline-diffs Display actual/expected differences
inline within each string [boolean]
--reporter, -R Specify reporter to use
[string] [default: "spec"]
--reporter-option, --reporter-options, Reporter-specific options
-O (<k=v,[k1=v1,..]>) [array]
Configuration
--config Path to config file [default: (nearest rc file)]
--opts Path to `mocha.opts` [string] [default: "./test/mocha.opts"]
--package Path to package.json for config [string]
File Handling
--exclude Ignore file(s) or glob pattern(s)
[array] [default: (none)]
--extension, --watch-extensions File extension(s) to load and/or watch
[array] [default: js]
--file Specify file(s) to be loaded prior to root
suite execution [array] [default: (none)]
--recursive Look for tests in subdirectories [boolean]
--require, -r Require module [array] [default: (none)]
--sort, -S Sort test files [boolean]
--watch, -w Watch files in the current working directory
for changes [boolean]
Test Filters
--fgrep, -f Only run tests containing this string [string]
--grep, -g Only run tests matching this string or regexp [string]
--invert, -i Inverts --grep and --fgrep matches [boolean]
Positional Arguments
spec One or more files, directories, or globs to test
[array] [default: ["test"]]
Other Options
--help, -h Show usage information & exit [boolean]
--version, -V Show version number & exit [boolean]
--interfaces List built-in user interfaces & exit [boolean]
--reporters List built-in reporters & exit [boolean]
✖ ERROR: Unknown "reporter": /mnt/c/Program Files/JetBrains/WebStorm 2019.2.4/plugins/NodeJS/js/mocha-intellij/lib/mochaIntellijReporter.js
Waiting for the debugger to disconnect...
Process finished with exit code 1
If I copy paste the first line into cmd though it runs. Seems to be an issue with quotes or something.
It doesn't work though, I get this:
C:\Users\iursino>C:\Users\iursino\AppData\Local\Microsoft\WindowsApps\ubuntu.exe run "export PATH=/home/iursino/n/bin:$PATH && /home/iursino/n/bin/node /mnt/c/workspace/project-name-redacted/node_modules/mocha/bin/_mocha --require ts-node/register --ui bdd --reporter \"/mnt/c/Program Files/JetBrains/WebStorm 2019.2.4/plugins/NodeJS/js/mocha-intellij/lib/mochaIntellijReporter.js\" /mnt/c/workspace/project-name-redacted/src/Filename.spec.ts --grep \"^invoke lambda Expect success result when invoking lambda$\""
/mnt/c/workspace/project-name-redacted/node_modules/ts-node/src/index.ts:245
return new TSError(diagnosticText, diagnosticCodes)
^
TSError: ⨯ Unable to compile TypeScript:
error TS2468: Cannot find global value 'Promise'.
../../workspace/project-name-redacted/src/Filename.spec.ts:3:8 - error TS1259: Module '"chai"' can only be default-imported using the 'esModuleInterop' flag
3 import chai, { expect } from 'chai'
~~~~
../../workspace/project-name-redacted/node_modules/#types/chai/index.d.ts:1921:5
1921 export = chai;
~~~~~~~~~~~~~~
This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
../../workspace/project-name-redacted/src/Filename.spec.ts:4:8 - error TS1259: Module '"chai-as-promised"' can only be default-imported using the 'esModuleInterop' flag
4 import chaiAsPromised from 'chai-as-promised'
~~~~~~~~~~~~~~
../../workspace/project-name-redacted/node_modules/#types/chai-as-promised/index.d.ts:20:5
20 export = chaiAsPromised;
~~~~~~~~~~~~~~~~~~~~~~~~
This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
../../workspace/project-name-redacted/src/Filename.spec.ts:9:1 - error TS2582: Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i #types/jest` or `npm i #types/mocha`.
9 describe('invoke lambda', () => {
~~~~~~~~
../../workspace/project-name-redacted/src/Filename.spec.ts:25:5 - error TS2304: Cannot find name 'beforeEach'.
25 beforeEach(() => {
~~~~~~~~~~
../../workspace/project-name-redacted/src/Filename.spec.ts:30:5 - error TS2582: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i #types/jest` or `npm i #types/mocha`.
30 it('Expect success result when invoking lambda', async () => {
~~
../../workspace/project-name-redacted/src/Filename.spec.ts:30:54 - error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
30 it('Expect success result when invoking lambda', async () => {
~~~~~~~~~~~~~
../../workspace/project-name-redacted/src/Filename.spec.ts:39:5 - error TS2582: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i #types/jest` or `npm i #types/mocha`.
39 it('Expect error if lambda returns an error', async () => {
~~
../../workspace/project-name-redacted/src/Filename.spec.ts:39:51 - error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
39 it('Expect error if lambda returns an error', async () => {
~~~~~~~~~~~~~
../../workspace/project-name-redacted/src/Filename.spec.ts:48:5 - error TS2582: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i #types/jest` or `npm i #types/mocha`.
48 it('Expect promise rejection if lambda returns an object as error (but not of type error)', async () => {
~~
../../workspace/project-name-redacted/src/Filename.spec.ts:48:98 - error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
48 it('Expect promise rejection if lambda returns an object as error (but not of type error)', async () => {
~~~~~~~~~~~~~
../../workspace/project-name-redacted/src/Filename.spec.ts:57:5 - error TS2304: Cannot find name 'afterEach'.
57 afterEach(() => {
~~~~~~~~~
at createTSError (/mnt/c/workspace/project-name-redacted/node_modules/ts-node/src/index.ts:245:12)
at reportTSError (/mnt/c/workspace/project-name-redacted/node_modules/ts-node/src/index.ts:249:19)
at getOutput (/mnt/c/workspace/project-name-redacted/node_modules/ts-node/src/index.ts:357:34)
at Object.compile (/mnt/c/workspace/project-name-redacted/node_modules/ts-node/src/index.ts:415:32)
at Module.m._compile (/mnt/c/workspace/project-name-redacted/node_modules/ts-node/src/index.ts:493:43)
at Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Object.require.extensions.(anonymous function) [as .ts] (/mnt/c/workspace/project-name-redacted/node_modules/ts-node/src/index.ts:496:12)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at /mnt/c/workspace/project-name-redacted/node_modules/mocha/lib/mocha.js:330:36
at Array.forEach (<anonymous>)
at Mocha.loadFiles (/mnt/c/workspace/project-name-redacted/node_modules/mocha/lib/mocha.js:327:14)
at Mocha.run (/mnt/c/workspace/project-name-redacted/node_modules/mocha/lib/mocha.js:804:10)
at Object.exports.singleRun (/mnt/c/workspace/project-name-redacted/node_modules/mocha/lib/cli/run-helpers.js:207:16)
at exports.runMocha (/mnt/c/workspace/project-name-redacted/node_modules/mocha/lib/cli/run-helpers.js:300:13)
at Object.exports.handler.argv [as handler] (/mnt/c/workspace/project-name-redacted/node_modules/mocha/lib/cli/run.js:296:3)
at Object.runCommand (/mnt/c/workspace/project-name-redacted/node_modules/yargs/lib/command.js:242:26)
at Object.parseArgs [as _parseArgs] (/mnt/c/workspace/project-name-redacted/node_modules/yargs/yargs.js:1087:28)
at Object.parse (/mnt/c/workspace/project-name-redacted/node_modules/yargs/yargs.js:566:25)
at Object.exports.main (/mnt/c/workspace/project-name-redacted/node_modules/mocha/lib/cli/cli.js:63:6)
at Object.<anonymous> (/mnt/c/workspace/project-name-redacted/node_modules/mocha/bin/_mocha:10:23)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
Why is it different in cmd and WebStorm? Another question: What's up with the error I get in cmd?
Edit: uploaded the cmd output in a redacted form.

Starting vue js dev server gives eror: .plugins[0] may only be a two-tuple or three-tuple

I am using Vue CLI version 3 to run a Vue application inside a Docker container. To start the development server, I run:
https://cli.vuejs.org/guide/cli-service.html
This gives the following error:
ERROR Failed to compile with 1 errors 17:05:14
error in ./app/main.js
Module build failed (from ./node_modules/#vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js):
Error: .plugins[0] may only be a two-tuple or three-tuple
at assertPluginItem (/home/src/node_modules/#babel/core/lib/config/validation/option-assertions.js:235:13)
at arr.forEach (/home/src/node_modules/#babel/core/lib/config/validation/option-assertions.js:222:30)
at Array.forEach (<anonymous>)
at assertPluginList (/home/src/node_modules/#babel/core/lib/config/validation/option-assertions.js:222:9)
at Object.keys.forEach.key (/home/src/node_modules/#babel/core/lib/config/validation/options.js:107:5)
at Array.forEach (<anonymous>)
at validateNested (/home/src/node_modules/#babel/core/lib/config/validation/options.js:83:21)
at validate (/home/src/node_modules/#babel/core/lib/config/validation/options.js:74:10)
at file (/home/src/node_modules/#babel/core/lib/config/config-chain.js:174:34)
at cachedFunction (/home/src/node_modules/#babel/core/lib/config/caching.js:33:19)
at buildRootChain (/home/src/node_modules/#babel/core/lib/config/config-chain.js:120:36)
at loadPrivatePartialConfig (/home/src/node_modules/#babel/core/lib/config/partial.js:85:55)
at Object.loadPartialConfig (/home/src/node_modules/#babel/core/lib/config/partial.js:110:18)
at Object.<anonymous> (/home/src/node_modules/#vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js:140:26)
at Generator.next (<anonymous>)
at asyncGeneratorStep (/home/src/node_modules/#vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js:3:103)
# multi (webpack)-dev-server/client/index.js ./node_modules/#vue/cli-service/node_modules/webpack/hot/dev-server.js ./app/main.js
I suspect that the offending code is the following, in my .babelrc file:
"plugins": [
["transform-runtime", "transform-vue-jsx", "transform-regenerator", {
"polyfill": false,
"regenerator": true
}]
Could someone suggest how I could go about resolving this? Thanks!
Your [ is in the wrong place. It should be
"plugins": [
"transform-runtime",
"transform-vue-jsx",
["transform-regenerator", {
"polyfill": false,
"regenerator": true
}]
]

$ Is not defined scripts Gulp task

Hi I am trying to run my scripts task in gulp. My scripts path is defined as follows:
scripts: {
coffee: [
'app/assets/scripts/**/*.coffee'
],
js: [
'src/js/*',
'src/js/**/*'
],
map: ['src/js/**/*.map']
},
My original file paths are located in root/src/js/ and I want my scripts to be placed in their minified version inside root/app/assets/scripts/.
My gulp task is as follows:
gulp.task('scripts', function() {
return gulp.src('app/scripts/**/*.js')
.pipe($.if('*.js', $.uglify({preserveComments: 'some'})))
.pipe($.sourcemaps.init())
.pipe($.concat('app.js'))
.pipe($.sourcemaps.write('./'))
.pipe(gulp.dest('app/assets/scripts'));
});
But for some reason I keep getting this error
[13:28:46] ReferenceError: $ is not defined
at Gulp.<anonymous> (C:\Users\Myuser\apps\myapp\gulpfile.js:165:9)
at module.exports (C:\Users\Myuser\apps\myapp\node_modules\gulp\node_
modules\orchestrator\lib\runTask.js:34:7)
at Gulp.Orchestrator._runTask (C:\Users\Myuser\apps\myapp\node_module
s\gulp\node_modules\orchestrator\index.js:273:3)
at Gulp.Orchestrator._runStep (C:\Users\Myuser\apps\myapp\node_module
s\gulp\node_modules\orchestrator\index.js:214:10)
at Gulp.Orchestrator.start (C:\Users\Myuser\apps\myapp\node_modules\g
ulp\node_modules\orchestrator\index.js:134:8)
at C:\Users\Myuser\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:129:2
0
at process._tickCallback (node.js:355:11)
at Function.Module.runMain (module.js:503:11)
at startup (node.js:129:16)
at node.js:814:3
UPDATE
Hey I think you are both right. $ was not defined and should be $ = require('gulp-load-plugins')();. However now that I am running scripts, I get the following error:
[15:24:46] TypeError: undefined is not a function
at Gulp.<anonymous> (C:\Users\Myuser\apps\myapp\gulpfile.js:166:13)
at module.exports (C:\Users\Myuser\apps\myapp\node_modules\gulp\node_
modules\orchestrator\lib\runTask.js:34:7)
at Gulp.Orchestrator._runTask (C:\Users\Myuser\apps\myapp\node_module
s\gulp\node_modules\orchestrator\index.js:273:3)
at Gulp.Orchestrator._runStep (C:\Users\Myuser\apps\myapp\node_module
s\gulp\node_modules\orchestrator\index.js:214:10)
at Gulp.Orchestrator.start (C:\Users\Myuser\apps\myapp\node_modules\g
ulp\node_modules\orchestrator\index.js:134:8)
at C:\Users\Myuser\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:129:2
0
at process._tickCallback (node.js:355:11)
at Function.Module.runMain (module.js:503:11)
at startup (node.js:129:16)
at node.js:814:3
Again, another vague error "undefined is not a function", is this explicit? Is there a $ function missing?
You probably need to use gulp-load-plugins package:
var $ = require('gulp-load-plugins')({lazy: true});

Resources