bradtraversy / react_webpack_starter

React 16 and Webpack 4 starter pack
277 stars 177 forks source link

Error webpack-dev-server --mode development --open --hot #4

Open bossajie opened 6 years ago

bossajie commented 6 years ago

image

I got this error when I npm install and npm start. Maybe it is not working for some old version of NPM? My Npm version is 5.11.1

bitmammoth commented 6 years ago

Im getting a similar error since moving to typescript before that move this repo worked great :) UPDATE: Typescript works fine in earlier commits ERROR in ./src/index.tsx
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: Unexpected token (20:16)

18 | var store_1 = __importStar(require("./store"));
19 | require("./styles/index.scss");

20 | ReactDOM.render(
| ^
21 |
22 |
23 | </react_router_redux_1.ConnectedRouter>

@ multi (webpack)-dev-server/client?http://localhost:8080 (webpack)/hot/dev-server.js ./src main[2]
Child html-webpack-plugin for "index.html":
1 asset
Entrypoint undefined = index.html
[./node_modules/html-webpack-plugin/lib/loader.js!./src/index.html] 500 bytes {0} [built]
[./node_modules/lodash/lodash.js] 527 KiB {0} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 489 bytes {0} [built]
[./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 497 bytes {0} [built]
ℹ 「wdm」: Failed to compile.

(edit): npm -v
6.0.1
node -v v9.11.1

So I don't think its a versioning issue...

EDIT tree:61d84ac579 and before do not have this issue and work correctly but there are warnings regarding npm audit and updates needed.

bossajie commented 6 years ago

@bitmammoth already fixed that error, you can check this repository -> https://github.com/ajiejot/reactjs-boilerplate .It is fully working with hot loader.

ahmedmusawir commented 5 years ago

THANKYOU ajiejot !! YOU ARE A LIFE SAVER ... I was about to lose my mind after a day's failed effort ... !!!

bossajie commented 5 years ago

THANKYOU ajiejot !! YOU ARE A LIFE SAVER ... I was about to lose my mind after a day's failed effort ... !!!

You're welcome. Happy coding 😃

iamcharlesb commented 4 years ago

@bitmammoth already fixed that error, you can check this repository -> https://github.com/ajiejot/reactjs-boilerplate .It is fully working with hot loader.

Thanks for sharing the link but this example reloads the entire page. Instead it will be great to reload the react component alone