Abbreviated webpack run error Uncaught TypeError: self.postMessage is not a function

Say good 2017Fix still able to reproduce, may be the older version of the project, summary records solution

 

1. Error:

index.js?bed3:67 Uncaught TypeError: self.postMessage is not a function
    at sendMsg (index.js?bed3:67)
    at Object.invalid (index.js?bed3:83)
    at SockJS.onmessage (socket.js?57b2:41)
    at SockJS.EventTarget.dispatchEvent (sockjs.js?3600:170)
    at eval (sockjs.js?3600:887)
    at Array.forEach (<anonymous>)
    at SockJS._transportMessage (sockjs.js?3600:885)
    at WebSocketTransport.EventEmitter.emit (sockjs.js?3600:86)
    at WebSocketTransport.ws.onmessage (sockjs.js?3600:2961)

 

2. Solution: Open the file node_modules \ webpack-dev-server \ client \ index.js, find the line 67 (or sendMsg method) to determine the type of supplementary conditions   && typeof self === 'function'

 Figure:

 

Guess you like

Origin www.cnblogs.com/dzone/p/11496642.html