rails / webpacker

Use Webpack to manage app-like JavaScript modules in Rails
MIT License
5.31k stars 1.47k forks source link

webpacker 6.0.0.rc.5 doesn't work with live code reloading #3191

Closed JonRCahill closed 2 years ago

JonRCahill commented 2 years ago

Creating a new Rails project using webpacker 6.0.0.rc.5.

Then following the instructions for live code reloading at: https://github.com/rails/webpacker#development

Results in the following error:

Uncaught TypeError: __webpack_require__.n is not a function
    at Object../node_modules/webpack-dev-server/client/index.js?protocol=ws%3A&hostname=localhost&port=3035&pathname=%2Fws&logging=info (WebSocketClient.js:42)
    at __webpack_require__ (bootstrap:19)
    at __webpack_exec__ (application.js:19)
    at application.js:19
    at Function.__webpack_require__.O (chunk loaded:22)
    at application.js:19
    at webpackJsonpCallback (make namespace object:3)
    at application.js:1
./node_modules/webpack-dev-server/client/index.js?protocol=ws%3A&hostname=localhost&port=3035&pathname=%2Fws&logging=info   @   WebSocketClient.js:42
__webpack_require__ @   bootstrap:19
__webpack_exec__    @   application.js:19
(anonymous) @   application.js:19
__webpack_require__.O   @   chunk loaded:22
(anonymous) @   application.js:19
webpackJsonpCallback    @   make namespace object:3
(anonymous) @   application.js:1

There are no other changes.

Not sure how to resolve this error?

n-rodriguez commented 2 years ago

Maybe update package.json to use 'webpacker', '~> 6.0.0.rc.5' ?

Like:

"@rails/webpacker": "https://github.com/rails/webpacker.git",
guillaumebriday commented 2 years ago

Can you share your package.json? @JonRCahill

guillaumebriday commented 2 years ago

Sorting some issues, feel free to reopen if it's a real bug, thanks