Skip to content
This repository has been archived by the owner on Dec 3, 2018. It is now read-only.

webpack --watch ignores changes in local dependencies after receiving syntax error there #8

Closed
garkin opened this issue Jun 9, 2017 · 14 comments

Comments

@garkin
Copy link

garkin commented Jun 9, 2017

https://github.com/garkin/bs_loader_webpack_watch_bug

Steps to reproduce

  1. git clone https://github.com/garkin/bs_loader_webpack_watch_bug
  2. npm install
  3. npm start to start watching using webpack
  4. Uncomment some syntax error line in the src/fib.re to break program and get an error
  5. Comment back some syntax error line in the src/fib.re to restore program correctness

Expected behavior:

After removing error in src/fib.re - changes are recompiled and we get console output about succesfull recompilation.

Actual behavior:

(5.) and further src/fib.re changes are not recompiled and we do not get updates in the console.
But changes in the entry src/index.re do trigger correct recompilation.

Environment:

Windows 10 
NodeJS v6.9.1

Centos 7
Linux 3.18.17-13.el7.x86_64
NodeJS v6.10.3

"bs-loader": "1.2.5"
"bs-platform": "1.7.4"
"reason-js": "0.3.0"
"webpack": "2.6.1"
@garkin
Copy link
Author

garkin commented Jun 9, 2017

My bad. It actually ignore changes after error in ANY file. Even in entry.
Can't reproduce. Described scenario with sample repo is still in place

@rrdelaney
Copy link
Owner

Can you paste your entire webpack config?

@garkin
Copy link
Author

garkin commented Jun 9, 2017

https://github.com/garkin/bs_loader_webpack_watch_bug/blob/master/webpack.config.js

const path = require('path');

module.exports = {
  entry: {
      core: "./src/index.re"
  },
  resolve: {
    extensions: ['.re', '.ml', '.js']
  },
  output: {
    path: path.resolve(__dirname, 'out'),
    filename: '[name].js'
  },
  module: {
    rules: [
      // https://github.com/rrdelaney/bs-loader
      { test: /\.(re|ml)$/, use: { loader: 'bs-loader', options: { module: 'es6' } } }
    ]
  }
}

@garkin garkin changed the title webpack --watch ignores changes in local dependencies after receiving error there webpack --watch ignores changes in local dependencies after receiving syntax error there Jun 9, 2017
@rrdelaney
Copy link
Owner

Try adding "errorType: warning" to the loader options

@garkin
Copy link
Author

garkin commented Jun 9, 2017

After adding:

use: { loader: 'bs-loader', options: { module: 'es6', errorType: "warning" } }"

Watching is working as intended, but there are no error output in the console at all.

@rrdelaney
Copy link
Owner

Does running "bsb-w" work for you?

@garkin
Copy link
Author

garkin commented Jun 9, 2017

Yes, bsb -w works as expected.

@rrdelaney
Copy link
Owner

Hmm. This is definitely weird. I think it might be an issue using this with Windows.

I can't look too much into it right now, but I'll check it out later.

@garkin
Copy link
Author

garkin commented Jun 9, 2017

I can reproduce it on CentOS.

@rrdelaney
Copy link
Owner

Thanks so much for trying again on another OS! That makes it easier for me to test 😄

@rrdelaney
Copy link
Owner

This is 100% not a Windows issue, thanks so much for proving an example repo where the issue can be seen! I'm working on this now

@rrdelaney
Copy link
Owner

rrdelaney commented Jun 11, 2017

Try out version 1.3.0 just published on npm 😃 I just tried it out on the demo repo and it works

Release Notes

@garkin
Copy link
Author

garkin commented Jun 11, 2017

Thank you, it's now fixed.

@garkin garkin closed this as completed Jun 11, 2017
@rrdelaney
Copy link
Owner

Hey! Thanks for submitting this issue 😄Reason-Scripts will automatically run "npm link bs-platform" upon install.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants