infernojs / create-inferno-app

Create Inferno apps with no build configuration.
MIT License
351 stars 34 forks source link

Hot Reloading of CSS and JS not working #15

Closed osdevisnot closed 7 years ago

osdevisnot commented 7 years ago

Can you reproduce the problem with latest npm?

Yes. My environment versions:

→ node --version
v7.1.0
→ npm --version
3.10.9
→ yarn --version
0.16.1
→ create-inferno-app version
1.1.2

Saw these errors while creating an app

warning inferno-scripts > jest > jest-cli > istanbul-api > fileset > minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning Incorrect peer dependency "babel-eslint@7.0.0".
warning Incorrect peer dependency "eslint@3.8.1".
warning Incorrect peer dependency "eslint-plugin-flowtype@2.21.0".
warning Incorrect peer dependency "eslint-plugin-import@2.0.1".
warning Incorrect peer dependency "eslint-plugin-jsx-a11y@2.2.3".
warning Incorrect peer dependency "eslint-plugin-inferno@6.6.0".

Description

What are you reporting?

On freshly created inferno-app, hot reloading for CSS and JS is not working.

Note: create-react-app works correctly for me.

Expected behavior

Page should reload with the latest changes.

Actual behavior

Browser does not refresh automatically.

Environment

Run these commands in the project folder and fill in their results:

  1. npm ls inferno-scripts (if you haven’t ejected):
  2. node -v:
  3. npm -v:
→ npm ls inferno-scripts
nextgen@0.1.0 /Users/abhishek/devel/oss/nextgen
└─┬ inferno-scripts@0.9.2
  ├── UNMET PEER DEPENDENCY babel-eslint@7.1.1
  ├── UNMET PEER DEPENDENCY eslint@3.12.2
  ├── UNMET PEER DEPENDENCY eslint-plugin-flowtype@2.29.1
  ├── UNMET PEER DEPENDENCY eslint-plugin-import@2.2.0
  ├── UNMET PEER DEPENDENCY eslint-plugin-inferno@6.8.0
  └── UNMET PEER DEPENDENCY eslint-plugin-jsx-a11y@3.0.2

npm ERR! peer dep missing: babel-eslint@7.0.0, required by eslint-config-inferno-app@0.4.0
npm ERR! peer dep missing: eslint@3.8.1, required by eslint-config-inferno-app@0.4.0
npm ERR! peer dep missing: eslint-plugin-flowtype@2.21.0, required by eslint-config-inferno-app@0.4.0
npm ERR! peer dep missing: eslint-plugin-import@2.0.1, required by eslint-config-inferno-app@0.4.0
npm ERR! peer dep missing: eslint-plugin-inferno@6.6.0, required by eslint-config-inferno-app@0.4.0
npm ERR! peer dep missing: eslint-plugin-jsx-a11y@2.2.3, required by eslint-config-inferno-app@0.4.0

Then, specify:

  1. Operating system: Max OS Sierra version 10.12.1
  2. Browser and version: Google chrome - Version 57.0.2962.0 canary (64-bit)

Reproducible Demo

Sorry it's just my local experiment project.

Havunen commented 7 years ago

Hey!

This is known issue Hot reloading modules are currently commented out. It re compiles but doesn't refresh browser. Are you able to send PR for this? I'm currently working on material-ui for Inferno.

joejsx commented 7 years ago

I think I found the issue.

Just change require.resolve('react-dev-utils/webpackHotDevClient') to require.resolve('inferno-dev-utils/webpackHotDevClient') in packages/inferno-scripts/config/webpack.config.dev.js

Also be sure to uncomment the two lines that were commented out:

// require.resolve('react-dev-utils/webpackHotDevClient'), // new webpack.HotModuleReplacementPlugin(),

Seems you just forgot to update the 'react' keyword to 'inferno' in this instance.

Havunen commented 7 years ago

Hey, good to hear! Can you send pull request @joejsx so you get credit for the fix :)

Havunen commented 7 years ago

@joejsx created PR for this and it has been merged. This should be resolved by now :)