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
Related
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
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
}]
]
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
I have a project that is started in development by
yarn start
It runs a index.js that starts a grunt process and get this error:
$ yarn start
yarn start v0.23.2
$ node ./development
grunt_arguments [ '--force', '--notify', '--verbose', '--debug', '--stack' ]
=======================================
Open http://localhost:8000 to start developing
events.js:141
throw er; // Unhandled 'error' event
^
Error: spawn ./node_modules/.bin/grunt ENOENT
at exports._errnoException (util.js:907:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:189:32)
at onErrorNT (internal/child_process.js:355:16)
at nextTickCallbackWith2Args (node.js:458:9)
at process._tickCallback (node.js:372:17)
at Function.Module.runMain (module.js:443:11)
at startup (node.js:139:18)
at node.js:990:3
error Command failed with exit code 1.
No idea what can it be. Environment is:
Win10
Running with MINGW64
I usually monkey patch child_process to help me debug that kind of issues. Add something like this in the beginning of your index.js file:
const util = require('util')
const childProcess = require("child_process");
const originalSpawn = childProcess.spawn;
childProcess.spawn = function() {
console.trace('SPAWN');
console.log('ARGS');
console.log(util.inspect(arguments, false, null)); // showHidden = false, depth = null
return originalSpawn.apply(this, arguments);
};
If your run, childProcess.spawn('ls', ['-lh', '/usr']) you will see something like:
Trace: SPAWN
at Object.childProcess.spawn (repl:2:9)
at myFunction (repl:2:14)
at repl:1:1
at REPLServer.defaultEval (repl.js:164:27)
at bound (domain.js:250:14)
at REPLServer.runBound [as eval] (domain.js:263:12)
at REPLServer.<anonymous> (repl.js:392:12)
at emitOne (events.js:82:20)
at REPLServer.emit (events.js:169:7)
at REPLServer.Interface._onLine (readline.js:210:10)
ARGS
{ '0': 'ls', '1': [ '-lh', '/usr' ] }
Maybe after running it you can update your question with the new information.
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});