Skip to content

Conversation

@niieani
Copy link
Contributor

@niieani niieani commented Mar 5, 2019

This PR contains:

  • bugfix
  • feature
  • refactor
  • tests
  • documentation
  • metadata

Breaking Changes?

  • yes
  • no

If yes, please describe the breakage.

Please Describe Your Changes

I do not know exactly what is the case in which this issue occurs, however this change should be enough to fix the issue.

Stacktrace:

uncaughtException TypeError: filePath.replace is not a function
    at WebpackPluginServe.socket.invalid (/project/node_modules/webpack-plugin-serve/lib/routes.js:80:35)
    at WebpackPluginServe.emit (events.js:194:15)
    at invalid.tap (/project/node_modules/webpack-plugin-serve/lib/index.js:155:41)
    at SyncHook.eval (eval at create (/project/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:1)
    at Watchpack.watcher.compiler.watchFileSystem.watch (/project/node_modules/webpack/lib/Watching.js:139:33)
    at Object.onceWrapper (events.js:277:13)
    at Watchpack.emit (events.js:189:13)
    at Watchpack._onChange (/project/node_modules/watchpack/lib/watchpack.js:118:7)
    at Watchpack.<anonymous> (/project/node_modules/watchpack/lib/watchpack.js:109:8)
    at Watcher.emit (events.js:189:13)
    at /project/node_modules/watchpack/lib/DirectoryWatcher.js:101:9
    at Array.forEach (<anonymous>)
    at DirectoryWatcher.setFileTime (/project/node_modules/watchpack/lib/DirectoryWatcher.js:99:42)
    at DirectoryWatcher.onChange (/project/node_modules/watchpack/lib/DirectoryWatcher.js:264:7)
    at FSWatcher.emit (events.js:189:13)
    at FSWatcher.<anonymous> (/project/node_modules/watchpack/node_modules/chokidar/index.js:199:15)
    at /project/node_modules/watchpack/node_modules/chokidar/index.js:238:7
    at FSReqWrap.oncomplete (fs.js:155:5)

I do not know exactly what is the case in which this issue occurs, however this change should be enough to fix the issue.

Stacktrace:

```
uncaughtException TypeError: filePath.replace is not a function
    at WebpackPluginServe.socket.invalid (/project/node_modules/webpack-plugin-serve/lib/routes.js:80:35)
    at WebpackPluginServe.emit (events.js:194:15)
    at invalid.tap (/project/node_modules/webpack-plugin-serve/lib/index.js:155:41)
    at SyncHook.eval (eval at create (/project/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:1)
    at Watchpack.watcher.compiler.watchFileSystem.watch (/project/node_modules/webpack/lib/Watching.js:139:33)
    at Object.onceWrapper (events.js:277:13)
    at Watchpack.emit (events.js:189:13)
    at Watchpack._onChange (/project/node_modules/watchpack/lib/watchpack.js:118:7)
    at Watchpack.<anonymous> (/project/node_modules/watchpack/lib/watchpack.js:109:8)
    at Watcher.emit (events.js:189:13)
    at /project/node_modules/watchpack/lib/DirectoryWatcher.js:101:9
    at Array.forEach (<anonymous>)
    at DirectoryWatcher.setFileTime (/project/node_modules/watchpack/lib/DirectoryWatcher.js:99:42)
    at DirectoryWatcher.onChange (/project/node_modules/watchpack/lib/DirectoryWatcher.js:264:7)
    at FSWatcher.emit (events.js:189:13)
    at FSWatcher.<anonymous> (/project/node_modules/watchpack/node_modules/chokidar/index.js:199:15)
    at /project/node_modules/watchpack/node_modules/chokidar/index.js:238:7
    at FSReqWrap.oncomplete (fs.js:155:5)
```
Copy link
Collaborator

@matheus1lva matheus1lva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently webpack is returning other than a string for the filename when an invalid compilation happens... interesting.

@shellscape
Copy link
Owner

My apologies for the delay in merging this. Really do appreciate the PR.

@shellscape shellscape merged commit 152d485 into shellscape:master Mar 18, 2019
@shellscape shellscape mentioned this pull request Mar 19, 2019
18 tasks
smashercosmo pushed a commit to smashercosmo/webpack-plugin-serve that referenced this pull request Jul 23, 2019
* handle uncaughtException

I do not know exactly what is the case in which this issue occurs, however this change should be enough to fix the issue.

Stacktrace:

```
uncaughtException TypeError: filePath.replace is not a function
    at WebpackPluginServe.socket.invalid (/project/node_modules/webpack-plugin-serve/lib/routes.js:80:35)
    at WebpackPluginServe.emit (events.js:194:15)
    at invalid.tap (/project/node_modules/webpack-plugin-serve/lib/index.js:155:41)
    at SyncHook.eval (eval at create (/project/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:1)
    at Watchpack.watcher.compiler.watchFileSystem.watch (/project/node_modules/webpack/lib/Watching.js:139:33)
    at Object.onceWrapper (events.js:277:13)
    at Watchpack.emit (events.js:189:13)
    at Watchpack._onChange (/project/node_modules/watchpack/lib/watchpack.js:118:7)
    at Watchpack.<anonymous> (/project/node_modules/watchpack/lib/watchpack.js:109:8)
    at Watcher.emit (events.js:189:13)
    at /project/node_modules/watchpack/lib/DirectoryWatcher.js:101:9
    at Array.forEach (<anonymous>)
    at DirectoryWatcher.setFileTime (/project/node_modules/watchpack/lib/DirectoryWatcher.js:99:42)
    at DirectoryWatcher.onChange (/project/node_modules/watchpack/lib/DirectoryWatcher.js:264:7)
    at FSWatcher.emit (events.js:189:13)
    at FSWatcher.<anonymous> (/project/node_modules/watchpack/node_modules/chokidar/index.js:199:15)
    at /project/node_modules/watchpack/node_modules/chokidar/index.js:238:7
    at FSReqWrap.oncomplete (fs.js:155:5)
```

* pass down the filePath verbatim

Co-Authored-By: niieani <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants