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

Running project #9

Closed
geakstr opened this issue Nov 22, 2015 · 9 comments
Closed

Running project #9

geakstr opened this issue Nov 22, 2015 · 9 comments

Comments

@geakstr
Copy link

geakstr commented Nov 22, 2015

Hello! I don't understand how to run project with profile. I did

gradle -Dspring.profiles.active=webpack,fake-redis bootRun

but http://localhost:3000 not found. gradle frontend:start and gradle backend:bootRun works

@millun
Copy link

millun commented Nov 25, 2015

Ran into the same problem. not quite sure how to cope with the js issue. mine goes like this:

.../frontend$ ../gradlew start
.............
.............

ERROR in ./src/config/router.js
Module not found: Error: Cannot resolve module 'isDev' in .../frontend/src/config
@ ./src/config/router.js 57:13-29

ERROR in ./src/config/store.js
Module not found: Error: Cannot resolve module 'isDev' in .../frontend/src/config
@ ./src/config/store.js 23:13-29

any hints appreciated. cheers

@geowarin
Copy link
Owner

Hey guys! Thanks for the feedback.

isDev is a node module, it should be installed in frontend/node_modules.
If you have npm installed, could you please use npm start in the frontend directory instead of relying on the webpack profile?
Also, what OS are you using?

I updated the node version used in the gradle node plugin but forgot to update it here:

public static final NODE_VERSION = '4.1.1'

It should say 5.0.0.

To be honest, the WebpackLauncher is a bit fragile. I should probably remove it and promote the use of npm instead.

@geowarin
Copy link
Owner

Another thing is you have to run gradle frontend:npmInstall or go in the frontend dir and type npm install before trying to run the frontend.

@geowarin
Copy link
Owner

Last word in favor of running npm start instead of using the webpack profile:
the output of the two processes will be cleanly separated. It is easier to see errors that way.
You can also restart one without touching the other, which is a big plus IMHO but I'd love to hear your thoughts and suggestions.

@geowarin
Copy link
Owner

And finally @geakstr, properties you pass to gradle are not passed over to spring so -Dspring.profiles.active will not work this way.

See spring-projects/spring-boot#832 and http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-profiles.html

@millun
Copy link

millun commented Nov 26, 2015

Hi! thanks for the response. Maybe I wasn't too specific.
I did try npm install too altogether with npm start but I ran into this exception
app.use('/api', (req, res) => {
^^
SyntaxError: Unexpected token =>
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
figure I might be using old nodejs? will try to upgrade... and let you know then.

I love the idea of your seed project btw!

@geowarin
Copy link
Owner

@millun Yes! The arrow notation for functions is for node 4.0.0+.

Guys, I pushed a new branch where the problem is fixed:
https://github.com/geowarin/boot-react/blob/210fb2f39cf0e393e82a267a85a34facd79a4795/backend/src/main/groovy/react/config/webpack/WebpackLauncher.groovy
but I find the code difficult to understand...

@nullsumme
Copy link

Just some comment about this problem:

ERROR in ./src/config/router.js
Module not found: Error: Cannot resolve module 'isDev' in .../frontend/src/config
@ ./src/config/router.js 57:13-29

I'm not sure if this is a platform (I'm on Ubuntu) problem but i had to rename the module import:

import isDev from 'isDev';

to

import isDev from 'isdev';

@geowarin
Copy link
Owner

@nullsumme You're totally right, that's a bug. I'll fix this ASAP.

geowarin added a commit that referenced this issue Dec 15, 2015
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