The full error trace is:
decode.js:32 Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'
at Module.<anonymous> (decode.js:32)
at Module../node_modules/querystring-es3/decode.js (decode.js:88)
at __webpack_require__ (bootstrap:19)
at Object../node_modules/querystring-es3/index.js (index.js:3)
at __webpack_require__ (bootstrap:19)
at Object.<anonymous> (client:6)
at Object../node_modules/webpack-dev-server/client/index.js?http://localhost:3035 (client:337)
at __webpack_require__ (bootstrap:19)
at Object.0 (log.js:47)
at __webpack_require__ (bootstrap:19)
Steps to reproduce:
rails new test2 --webpack
cd test2
rails g controller pages home
./bin/webpack-dev-server
rails s
# navigate to localhost:3000/pages/home
There is no error if you just run rails s and rely on webpack compile on demand.
...the earlier workaround ( add environment.loaders.delete('nodeModules') to environment.js ) makes webpack-dev-server work again
Please tell me if https://github.com/rails/webpacker/issues/2109#issuecomment-498336919 helps at all.
Was this issue resolved?
@jakeNiemiec yes, resolved. No js error with above steps with latest rails/webpacker.
Most helpful comment
...the earlier workaround ( add
environment.loaders.delete('nodeModules')toenvironment.js) makeswebpack-dev-serverwork again