Error when using webpack in watch mode
I have updated to the latest release of this library (3.4.0), and that caused the watch script I've added to package.json (actually it is just webpack -d -w) to break. It breaks with this error message:
/Users/daniel.rotter/Development/massiveart/sulu-minimal/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:145
if(key.startsWith(what))
^
TypeError: Cannot read property 'startsWith' of undefined
at Storage.purge (/Users/daniel.rotter/Development/massiveart/sulu-minimal/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:145:10)
at Storage.purge (/Users/daniel.rotter/Development/massiveart/sulu-minimal/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:150:9)
at CachedInputFileSystem.purge (/Users/daniel.rotter/Development/massiveart/sulu-minimal/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:259:20)
at Watchpack.watcher.once (/Users/daniel.rotter/Development/massiveart/sulu-minimal/node_modules/webpack/lib/node/NodeWatchFileSystem.js:42:26)
at Object.onceWrapper (events.js:318:30)
at emitTwo (events.js:125:13)
at Watchpack.emit (events.js:213:7)
at Watchpack._onTimeout (/Users/daniel.rotter/Development/massiveart/sulu-minimal/node_modules/watchpack/lib/watchpack.js:142:7)
at ontimeout (timers.js:488:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:283:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ watch: `webpack -d -w`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ watch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
The initial build works, but this error occurs after I save a file being watched. Is there some compatability issue with this release?
If I downgrade to version 3.3.0 of this library the watch task is working again.
Just wanted to report the same issue.
Also getting this issue.
Looks like we have an undefined key here, likely from commit 03ef8f2:
for(var key of this.data.keys()) {
if(key.startsWith(what))
this.data.delete(key);
}
In a rush so I had to edit it like below as a temporary workaround:
for(var key of this.data.keys()) {
if (typeof key !== "string") {
continue;
}
if(key.startsWith(what))
this.data.delete(key);
}
Hope this can be fixed soon.
Getting the same problem using version 3.4.0
+1
+1
+1
Same error here.
webpack: Compiling...
/Users/Gustavo/Desktop/canvas-test/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:145
if(key.startsWith(what))
^
TypeError: Cannot read property 'startsWith' of undefined
Same issue, had to downgrade again. Seems to work in 3.2.0.
It even works in 3.3.0 @the-architect
+1
+1
@smares yeah sorry, yarn was still installing 3.4.0.
Just facing the same error in 3.3.0
My script: cross-env NODE_ENV=development webpack-dev-server -d --inline --hot
When I edit my code and trigger the hot reload, the error shows and break the dev server
+1
+1
+1
+1
+1
+1