parcel-bundler / parcel

The zero configuration build tool for the web. 📦🚀
https://parceljs.org
MIT License
43.38k stars 2.27k forks source link

🐛 on page reload: message.split is not a function #814

Closed mischnic closed 6 years ago

mischnic commented 6 years ago

🐛 bug report

😯 Current Behavior

First load of page works. But when refreshing the page:

yarn run v1.3.2
$ standard && parcel src/index.html -p 3000 --open
Server running at http://localhost:3000
✨  Built in 32.58s.
/Users/niklas/Sites/hyperapp-todo-parcel/node_modules/parcel-bundler/src/Logger.js:27
      this.lines += message.split('\n').length;
                            ^

TypeError: message.split is not a function
    at Logger.write (/Users/niklas/Sites/hyperapp-todo-parcel/node_modules/parcel-bundler/src/Logger.js:27:29)
    at Logger.log (/Users/niklas/Sites/hyperapp-todo-parcel/node_modules/parcel-bundler/src/Logger.js:38:10)
    at WebSocket.handleSocketError (/Users/niklas/Sites/hyperapp-todo-parcel/node_modules/parcel-bundler/src/HMRServer.js:88:12)
    at WebSocket.onError (/Users/niklas/Sites/hyperapp-todo-parcel/node_modules/ws/lib/event-target.js:128:16)
    at WebSocket.emit (events.js:160:13)
    at WebSocket.finalize (/Users/niklas/Sites/hyperapp-todo-parcel/node_modules/ws/lib/websocket.js:190:41)
    at Socket.emit (events.js:165:20)
    at emitErrorNT (internal/streams/destroy.js:64:8)
    at process._tickCallback (internal/process/next_tick.js:152:19)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

💁 Possible Solution

Looks like a error with HMR, because it works with --no-hmr.

Maybe because of version bumping?

💻 Code Sample

Repo: https://github.com/marcusasplund/hyperapp-todo-parcel

yarn
yarn upgrade parcel-bundler
yarn start

@marcusasplund

🌍 Your Environment

Software Version(s)
Parcel 1.6.0
Node 9.5.0
npm/Yarn 1.3.2
Operating System macOS
FalkoJoseph commented 6 years ago

Got the same error suddenly.

MarcusAhlfors commented 6 years ago

Seeing the same problem, and the fix in #816 fixes the problem

AdamRamberg commented 6 years ago

+1

DeMoorJasper commented 6 years ago

fixed in #815

devongovett commented 6 years ago

Released to npm in v1.6.1.