Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0.6] using webpack-dev-server in fresh rails app results in Uncaught TypeError #2114

Closed
lastobelus opened this issue Jun 1, 2019 · 4 comments · Fixed by #2624
Closed

Comments

@lastobelus
Copy link

lastobelus commented Jun 1, 2019

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.

@lastobelus
Copy link
Author

...the earlier workaround ( add environment.loaders.delete('nodeModules') to environment.js ) makes webpack-dev-server work again

@jakeNiemiec
Copy link
Member

jakeNiemiec commented Jun 3, 2019

Please tell me if #2109 (comment) helps at all.

@jakeNiemiec
Copy link
Member

Was this issue resolved?

@lastobelus
Copy link
Author

@jakeNiemiec yes, resolved. No js error with above steps with latest rails/webpacker.

jakeNiemiec added a commit to jakeNiemiec/webpacker that referenced this issue Jun 8, 2020
gauravtiwari pushed a commit that referenced this issue Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants