Closed mraible closed 4 years ago
When I try to run my Node.js backend, I get all kinds of errors.
ERROR in ./src/main/webapp/app/shared/layout/menus/entities.tsx
Module Error (from ./node_modules/thread-loader/dist/cjs.js):
/Users/mraible/nodejs/src/main/webapp/app/shared/layout/menus/entities.tsx
12:8 error 'Translate' is not defined react/jsx-no-undef
15:8 error 'Translate' is not defined react/jsx-no-undef
18:8 error 'Translate' is not defined react/jsx-no-undef
21:8 error 'Translate' is not defined react/jsx-no-undef
✖ 4 problems (4 errors, 0 warnings)
@ ./src/main/webapp/app/shared/layout/menus/index.ts 3:0-27 3:0-27
@ ./src/main/webapp/app/shared/layout/header/header.tsx
@ ./src/main/webapp/app/app.tsx
@ ./src/main/webapp/app/index.tsx
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! health-points@0.0.1-SNAPSHOT webpack: `node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js "--config" "webpack/webpack.prod.js" "--profile"`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the health-points@0.0.1-SNAPSHOT webpack 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! /Users/mraible/.npm/_logs/2020-08-11T05_38_06_382Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! health-points@0.0.1-SNAPSHOT webpack:prod:main: `npm run webpack -- --config webpack/webpack.prod.js --profile`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the health-points@0.0.1-SNAPSHOT webpack:prod:main 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! /Users/mraible/.npm/_logs/2020-08-11T05_38_06_421Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! health-points@0.0.1-SNAPSHOT webpack:prod: `npm run cleanup && npm run webpack:prod:main`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the health-points@0.0.1-SNAPSHOT webpack:prod 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! /Users/mraible/.npm/_logs/2020-08-11T05_38_06_441Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! health-points@0.0.1-SNAPSHOT build: `npm run webpack:prod`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the health-points@0.0.1-SNAPSHOT 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! /Users/mraible/.npm/_logs/2020-08-11T05_38_06_458Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! health-points@0.0.1-SNAPSHOT start:app: `npm run build && cd server && npm run start`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the health-points@0.0.1-SNAPSHOT start:app 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! /Users/mraible/.npm/_logs/2020-08-11T05_38_06_481Z-debug.log
I'll try re-generating without i18n.
Doh! It fails when I remove the last 3 keys from the main configuration. New JDL:
application {
config {
applicationType monolith
baseName HealthPoints
packageName com.okta.developer
authenticationType oauth2
prodDatabaseType postgresql
buildTool gradle
testFrameworks [protractor]
clientFramework react
useSass true
}
entities Points, BloodPressure, Weight, Preferences
}
entity BloodPressure {
timestamp ZonedDateTime required
systolic Integer required
diastolic Integer required
}
entity Weight {
timestamp ZonedDateTime required
weight Double required
}
entity Points {
date LocalDate required
exercise Integer
meals Integer
alcohol Integer
notes String maxlength(140)
}
entity Preferences {
weeklyGoal Integer required min(10) max(21)
weightUnits Units required
}
enum Units {
KG,
LB
}
relationship OneToOne {
Preferences{user(login)} to User
}
relationship ManyToOne {
BloodPressure{user(login)} to User,
Weight{user(login)} to User,
Points{user(login)} to User
}
paginate BloodPressure, Weight with infinite-scroll
paginate Points with pagination
Result:
> HealthPoints@0.0.1 start /Users/mraible/nodejs/server
> npm run clean && npm run copy-resources && nodemon --watch src -e ts,tsx --exec ts-node src/main.ts
> HealthPoints@0.0.1 clean /Users/mraible/nodejs/server
> rimraf dist
> HealthPoints@0.0.1 copy-resources /Users/mraible/nodejs/server
> ts-node scripts/copy-resources.ts
sh: ts-node: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! HealthPoints@0.0.1 copy-resources: `ts-node scripts/copy-resources.ts`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the HealthPoints@0.0.1 copy-resources script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/mraible/.npm/_logs/2020-08-11T05_42_09_329Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! HealthPoints@0.0.1 start: `npm run clean && npm run copy-resources && nodemon --watch src -e ts,tsx --exec ts-node src/main.ts`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the HealthPoints@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/mraible/.npm/_logs/2020-08-11T05_42_09_351Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! health-points@0.0.1-SNAPSHOT start:app: `npm run build && cd server && npm run start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the health-points@0.0.1-SNAPSHOT start:app 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! /Users/mraible/.npm/_logs/2020-08-11T05_42_09_373Z-debug.log
Execution time: 24 s.
Just realized this happens because I didn't run npm install
. I think the printed text should be improved to say:
Run your application (after npm install in root folder and server folder) :
npm i && cd server && npm i
npm run start:app
Otherwise, run the npm scripts explained under README.md and server/README.md
After getting it all up and running, I started Keycloak using Docker Compose. When I click sign in on the homepage, it results in the following error.
Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
in Lifecycle (created by Context.Consumer)
in Redirect (created by Context.Consumer)
in Route (created by PrivateRouteComponent)
in PrivateRouteComponent (created by Connect(PrivateRouteComponent))
in Connect(PrivateRouteComponent) (created by Routes)
in Switch (created by Routes)
in div (created by Routes)
in Routes (created by App)
in ErrorBoundary (created by App)
in div (created by Card)
in Card (created by App)
in div (created by App)
in div (created by App)
in Router (created by BrowserRouter)
in BrowserRouter (created by App)
in App (created by HotExportedApp)
in AppContainer (created by HotExportedApp)
in HotExportedApp (created by ConnectFunction)
in ConnectFunction
in div
in Provider
in ErrorBoundary
Hi @mraible , thanks for the feedbacks! So the error for i18n, is due to the feature not implemented for nhipster (see #119 , @Aragonbn90 has the issue in progress).
Just realized this happens because I didn't run
npm install
. I think the printed text should be improved to say:Run your application (after npm install in root folder and server folder) : npm i && cd server && npm i npm run start:app Otherwise, run the npm scripts explained under README.md and server/README.md
The reason is that there are some mode to run the application with the scripts explained in README. For the last, it seems an error of react client maybe for the previous wrong generation.
Please try these steps:
Just realized this happens because I didn't run
npm install
. I think the printed text should be improved to say:Run your application (after npm install in root folder and server folder) : npm i && cd server && npm i npm run start:app Otherwise, run the npm scripts explained under README.md and server/README.md
Maybe I could replace this log with:
Run your application: npm i && cd server && npm i && cd .. && npm run start:app Otherwise, run the npm scripts explained under README.md and server/README.md
How do you say, Matt?
Hi @mraible , I have improved the generator with i18n feature that fixes the error with your jdl. Besides I have added also it in nhipster integration tests, so it's all ok! : https://github.com/jhipster/generator-jhipster-nodejs/blob/master/test-integration/samples/monolith-react-oauth2-i18n-jdl/monolith-react-oauth2-i18n-jdl.jdl
Describe the bug
I tried creating a new app with the following JDL.
I'm using Node.js v14.7.0.
To Reproduce
Steps to reproduce the behavior:
nodejs
directory and save the above JDL innodejs/app.jdl
nhipster import-jdl app.jdl
The first:
Why are there so many warnings?
The 2nd:
I already have 6.10.1 installed globally. I re-installed it and ran it again to confirm it happens a 2nd time.
The 3rd:
i18n on the frontend should be part of the main generator.
Also, I noticed the latest version of the NHipster uses Keycloak 9. The main generator uses Keycloak 10 so you might want to do a re-sync.