cyverse / troposphere-kaizen

☁️ how you make the cloud do your bidding
Other
1 stars 1 forks source link

Problem: ERROR during `npm start` or build #6

Closed lenards closed 7 years ago

lenards commented 7 years ago

When I do a pull of the repo, then following the steps mentioned to "start" the dev server we encounter an error.

So, when I do:

npm install
npm run build
# or 
npm start

We get the following error:

ERROR in ./~/lore/es/loaders/config.js
Module not found: Error: Can't resolve '/Users/lenards/devel/troposphere-kaizen/config/env' in '/Users/lenards/devel/troposphere-kaizen/node_modules/lore/es/loaders'
 @ ./~/lore/es/loaders/config.js 29:16-78
 @ ./~/lore/es/loader.js
 @ ./~/lore/es/app/index.js
 @ ./~/lore/es/index.js
 @ ./index.js
 @ multi (webpack)-dev-server/client?http://localhost:3000 webpack/hot/dev-server ./index.js

This might be because there is a missing peer dependency. Not sure yet.

lenards commented 7 years ago

This blocks me writing tests at the moment.

I did try to install peerDependencies, and it still has same error.

I did notice that redux-devtools-dock-monitor seems to want older React modules, but since I installed 16.* ... it's complaining:

13:35 $ npm install 
npm WARN redux-devtools-dock-monitor@1.1.2 requires a peer of react@^0.14.9 || ^15.3.0 but none is installed. You must install peer dependencies yourself.

up to date in 4.707s

That is definitely not the cause of the error I'm hitting, though.

lenards commented 7 years ago

I know that I haven't done this:

npm install -g lore-cli

Jason - maybe you're too used to this being available 😄

lenards commented 7 years ago

It looks like we don't have clarity in how ./config/env gets populated.

To the Lore Tutorial!

lenards commented 7 years ago

Maybe I'm giving off bad vibes ...

https://github.com/lore/lore/issues/173

lenards commented 7 years ago

That was "user operation error" ...

TIL: when an "npm start" errors, the webpack-dev-server holds onto the port.

lenards commented 7 years ago

My current directory direction is ./config under the troposphere-kaizen repo ...

So I stole ./config/env/* from lore-quickstart ... just copied the README.md, development.js, & production.js from there and did a mkdir env/ from ./config,

And now the application starts.

screen shot 2017-12-01 at 3 20 54 pm

lenards commented 7 years ago

Ugh ... so I can't run a tutorial and kaizen at the same time, looks like the webtask is calling back to 3000, so it must be there to login.

lenards commented 7 years ago

Okay ... got it to load.

We could write up the 3000 port expectation, but we want the webtask to be "short lived" anyway. I'll close this for now.

jchansen commented 7 years ago

@lenards I think the port issue needs to be addressed formally, as it's likely just going to keep coming up, and currently requires people to edit the npm start script in the package.json file to change it.

Connor taught me you can you pass arguments to npm by using this syntax:

npm start -- --port=3001

But to get it to work, it appears you can't have specified the argument already in the script. Meaning that command won't work if the npm start script looks like this (which it does, with --port at the end):

"start": "webpack-dev-server --history-api-fallback --hot --env=development --port=3000"

But if I change the strategy to set the default port directly in the webpack.config.js, and remove it from the npm start script, then we'll be able to override the default port easily using npm start -- --port=3001.

I'll submit a PR with that change.