jhipster app fails to run - no obvious error - jhipster

I'm attempting to run a basic Jhipster application, from the below .jdl file.
I run the following commands:
jhipster import-jdl sample.jdl
./mvnw
After build completes I open my browser to http://127.0.1.1:8080/
From there I see the following error:
JDL file
application {
config {
baseName sample,
applicationType monolith,
packageName com.sample.myapp,
prodDatabaseType postgresql,
cacheProvider infinispan,
buildTool maven,
useSass true,
testFrameworks [protractor]
}
entities *
}
entity Parent {
symbol String unique
description String
}
entity Child {
location String unique
comment String
balance Long
childType ChildType
}
enum ChildType {
ALPHA,
BETA
}
relationship OneToMany {
Parent to Child
}
Logs
The log can be viewed at https://gist.github.com/magick93/72354c7f20c52180b0ffa53ae5b6b70b
Versions
Java
openjdk 12.0.2 2019-07-16
OpenJDK Runtime Environment (build 12.0.2+10)
OpenJDK 64-Bit Server VM (build 12.0.2+10, mixed mode, sharing)
Node
node v12.16.2
npm 6.14.4
Jhipster
INFO! Using JHipster version installed locally in current project's node_modules
Additional
I've also tried
npm install
npm start
jhipster import-jdl sample.jdl
./mvnw
But still get the same error

As it says, The problem is because of npm install is not run properly!
Try to run following commands in sequence.
npm install
npm start
and then try to import your .jdl or .jh file by,
jhipster import-jdl sample.jdl
then
./mvnw

Excuse me if that sounds stupid: But which browser are you using?
I have a similar behaviour with Firefox 75.0: When I start a vanilla jhipster generated application the error above is shown and I can see that there is no call to the backend. The JavaScript console just prints.
"TypeError: clazz.decorators is undefined"
When I use Chrome the application seems to work fine (again: plain vanilla jhipster application without any added entities)

Related

jhipster registerModule gets error "Could not add jhipster module configuration"

I'm new to jhipster/yeoman, I have generated my jhipster-module taking advantage of generator-jhipster-module. I followed all the steps as documented (https://www.jhipster.tech/modules/creating-a-module/) in order to create the post entity creation hook.
After some configuration I need to execute:
yo jhipster-my-module
the result is the module installed but with this error:
Could not add jhipster module configuration
After running, into the generated application by jhipster, the entity sub-generator
jhipster entity EntityName
the jhipster-my-module does not start into post entity creation phase.
Debbuging the generator-jhipster/generators/generator-base.js the error is modules.push is not a function
This happen with the generator-jhipster version 5.0.0, instead using the 4.14.4 it works.
If you don't need to develop your jhipster-module with version 5.0.0 of generator-jhipster you can use the 4.14.4 version, e.g.
...
"dependencies": {
"generator-jhipster": "^4.14.4",
...
But it remains the open point on 5.0.0 version.

PM2 starting Meteor App not working

I have in one Digital Ocean Linux Ubuntu 16.041 droplet an instance of a Meteor app. Moreover, I installed Node.js version of 4.4.0
I created the respective bundle on the path ~/MyApplication/bundle. As a matter of fact, I automated with a config.json file the execution which its body contains the following code:
My main.js file is created from the Meteor build --directory ~/myDirectory/ command and contains the following code:
process.argv.splice(2, 0, 'program.json');
process.chdir(require('path').join(__dirname, 'programs', 'server'));
require('./programs/server/boot.js');
That being said, I run my application with pm2 through the config JSON file with pm2 start config.json
It starts the application, but several ms afterwards it is errored. The log error show the following exception regarding the typo, but seems the mainjs file is created fine. Any suggestions to solve it?
In the end, I had to update the node version in the server from 4.4.0 to 8.9.1. After doing that changes, I also had to install the dependencies within the bundle/programs/server/ using npm install

No ember-cli-build.js found

I'm trying run an Ember project locally : https://github.com/cosmicjs/ember-real-estate-website?files=1. I'm using pycharm 2017 using git-bash as my terminal in win7. I have npm , node and ember installed . In pycharm my project looks like the screenshot.
I've been advised to build the project (Emberjs: Failed to find a valid digest in the 'integrity' attribute , although this is not discussed in the instructions):
$ ember build
Running without permission to symlink will degrade build performance.
See http://ember-cli.com/user-guide/#windows for details.
- BuildingNo ember-cli-build.js found.
You can see the file in the screenshot. What am I doing wrong?

Express app with Node-sass on Azure App Service

I have a basic node web application using express that has a dependency on the node-sass library.
This is being built on a Win64 server, so during the npm install part of the build it is downloading the x64 version of the binding binary due to the current environment.
When its deployed to Azure App Service it throws a runtime error due to incompatability with the node-sass binding binary, as node runs 32bit in Azure App Service...
Error: Missing binding
D:\home\site\wwwroot\node_modules\node-sass\vendor\win32-ia32-48\binding.node
Node Sass could not find a binding for your current environment:
Windows 32-bit with Node.js 6.x
Found bindings for the following environments:
- Windows 64-bit with Node.js 6.x
When i explicitly check in the 32bit binding and re-deploy i sometimes get a 502 gateway error...
502 - Web server received an invalid response while acting as a
gateway or proxy server. There is a problem with the page you are
looking for, and it cannot be displayed. When the Web server (while
acting as a gateway or proxy) contacted the upstream content server,
it received an invalid response from the content server.
and other times i simply get a 500, but it no longer writes the error to the log.
The app depends on node-sass-middleware package version 0.11 explicitly, which depends on node-sass 4.3.0.
Without any error logs i am at a dead end. Have you come across this issue before, and if so, how did you resolve it?
I leveraged Node-Sass Example App to have quick test, used local git to deploy it sample project to Azure Web Apps, which reproduced your issue.
Via the deployment log:
remote: Selected node.js version 7.4.0. Use package.json file to choose a different version.
remote: Selected npm version 4.0.5
And according the similar error message:
Found bindings for the following environments: - Windows 64-bit with Node.js 6.x
I specified the node.js version in package.json to:
"engines": {
"node": "= 6.9.1",
"npm": "> 3"
}
Then redeploy it to Azure via local git, and the sample works fine.
For your further 500 error, you can try to leverage App Service Editor to check the output of your website.
Enter the App Service Editor from Azure portal, switch to output section by clicking the show output button, then click run to start the application.
We eventually resolved this by swapping out node-sass-middleware for gulp-sass, and also adding an npm rebuild step for node-sass. The key difference here is that the css is now rendered during the build process via gulp. Running npm rebuild node-sass first would invoke the binding download to the build server (if necessary), and then a separate task would invoke a gulp task to render the css.
The remainder of our problem was due to the fact that the web.config specified app.js as the entry point, but express4 uses the bin/www file, and simply references app.js. The problem with bin/www being the entry point is that iisnode now uses bin as the working directory, which caused issues with root relative references.
Rather than waste any more time trying to figure out if we could configure a different working directory, we simply moved bin/www to ./server.js and changed the web.config to point to server.js
The express app now runs as expected on azure websites.

How do I install a required package on IBM Bluemix when deploying a Meteor application from DevOps Services?

I hope there is an IBM Bluemix wizard watching that can answer this.
I have an application, written in Meteor, which I am trying to deploy to Bluemix. The application contains this line:
var AdmZip = Npm.require('adm-zip');
which of course means that the application uses the adm-zip package to do stuff. When I try to deploy the application via DevOps Services, it fails with this error:
ERR Error: Cannot find module 'adm-zip'
in the logs. If I remove the Npm.require line, the application deploys fine, but of course doesn't work correctly because adm-zip is not there.
My package.json file contains, among other things, this entry:
"dependencies": {
"adm-zip": "*"
},
which I believe should be sufficient to load the adm-zip package. I've also tried specifying a Git URL for adm-zip but the results are the same.
Does anyone know what I have to do to get this application to deploy correctly?
Looking at the Meteor documentation the following line...
// import a global NPM package
var Spooky = Npm.require('spooky');
...tries to import a global NPM package (installed with the -g flag).
There is a plugin for Meteor that handles NPM integration.
Install this module with the following command:
$ meteor add meteorhacks:npm
If you have correctly set up the package dependency in package.json, you can use the following to import and use the spooky package:
// This method loads NPM modules you've specified in the packages.json file.
var Spooky = Meteor.require('spooky');

Resources