Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled rejection Error: Invalid arguments #21

Open
Kamilius opened this issue May 30, 2016 · 5 comments
Open

Unhandled rejection Error: Invalid arguments #21

Kamilius opened this issue May 30, 2016 · 5 comments

Comments

@Kamilius
Copy link

Kamilius commented May 30, 2016

I'm getting this error while trying to force webpack dev server to write files it serves for webpack itself. Most of files are successfuly "written" into a "dest" directory. But it fails at some point with following stack trace, which actually doesn't help to understand a problem:

[11:57:28] [write-file-webpack-plugin] asset: ./main-9c5ec44d5dd566b19756.js; destination: ./dist/main-9c5ec44d5dd566b19756.js [written] (6.39 MB)
[11:57:28] [write-file-webpack-plugin] asset: ./main-9c5ec44d5dd566b19756.css; destination: ./dist/main-9c5ec44d5dd566b19756.css [written] (479.77 KB)
[11:57:28] [write-file-webpack-plugin] asset: ./main-9c5ec44d5dd566b19756.js.map; destination: ./dist/main-9c5ec44d5dd566b19756.js.map [written] (7.64 MB)
[11:57:28] [write-file-webpack-plugin] asset: ./main-9c5ec44d5dd566b19756.css.map; destination: ./dist/main-9c5ec44d5dd566b19756.css.map [written] (106 B)
Unhandled rejection Error: Invalid arguments
    at filesize (/Users/example/project/node_modules/filesize/lib/filesize.js:50:10)
    at /Users/example/project/node_modules/write-file-webpack-plugin/dist/index.js:192:128
    at /Users/example/project/node_modules/write-file-webpack-plugin/node_modules/lodash/_createBaseFor.js:17:11
    at baseForOwn (/Users/example/project/node_modules/write-file-webpack-plugin/node_modules/lodash/_baseForOwn.js:13:20)
    at /Users/example/project/node_modules/write-file-webpack-plugin/node_modules/lodash/_createBaseEach.js:17:14
    at forEach (/Users/example/project/node_modules/write-file-webpack-plugin/node_modules/lodash/forEach.js:38:10)
    at Compiler.<anonymous> (/Users/example/project/node_modules/write-file-webpack-plugin/dist/index.js:166:35)
    at Compiler.applyPlugins (/Users/example/project/node_modules/tapable/lib/Tapable.js:26:37)
    at Watching._done (/Users/example/project/node_modules/webpack/lib/Compiler.js:78:17)
    at Watching.<anonymous> (/Users/example/project/node_modules/webpack/lib/Compiler.js:61:18)
    at Compiler.emitRecords (/Users/example/project/node_modules/webpack/lib/Compiler.js:282:37)
    at Watching.<anonymous> (/Users/example/project/node_modules/webpack/lib/Compiler.js:58:19)
    at /Users/example/project/node_modules/webpack/lib/Compiler.js:275:11
    at Compiler.applyPluginsAsync (/Users/example/project/node_modules/tapable/lib/Tapable.js:60:69)
    at Compiler.afterEmit (/Users/example/project/node_modules/webpack/lib/Compiler.js:272:8)
    at Compiler.<anonymous> (/Users/example/project/node_modules/webpack/lib/Compiler.js:267:14)
    at /Users/example/project/node_modules/async/lib/async.js:52:16
    at Object.async.forEachOf.async.eachOf (/Users/example/project/node_modules/async/lib/async.js:236:30)
    at Object.async.forEach.async.each (/Users/example/project/node_modules/async/lib/async.js:209:22)
    at Compiler.emitFiles (/Users/example/project/node_modules/webpack/lib/Compiler.js:235:20)
    at MemoryFileSystem.(anonymous function) [as mkdirp] (/Users/example/project/node_modules/webpack-dev-middleware/node_modules/memory-fs/lib/MemoryFileSystem.js:283:10)
    at Compiler.<anonymous> (/Users/example/project/node_modules/webpack/lib/Compiler.js:229:25)

Settings are all corresponding to a guide provided in README.md. devServer has an outputPath which equals to webpack.output.path.

Any thoughts?

@Kamilius
Copy link
Author

At some point not a size of file, but a whole object is passed into "filesize" method, which fails a build. To fix that, a check what actually should be provided - parameter, or it's possible property "size", needs to be implemented.

@dfjones1981
Copy link

I had this error also, it failed when trying to process my favicon.png file:
new HtmlWebpackPlugin({ template: './src/index.html', inject: 'body', favicon: './src/favicon.png' }),

maybe that's a way to reproduce the error?

@gajus
Copy link
Owner

gajus commented Sep 15, 2016

At some point not a size of file, but a whole object is passed into "filesize" method, which fails a build.

Can you build a test case for this?

@Kamilius
Copy link
Author

Kamilius commented Sep 15, 2016

@gajus I'll try if will have some spare time. Also need to remember what actually I've wanted to achieve back then (May 30).

Could you point me towards contribution manual? What are you using for unit-testing? (or testing in general)

@gajus
Copy link
Owner

gajus commented Sep 15, 2016

Could you point me towards contribution manual? What are you using for unit-testing? (or testing in general)

Woah. A project without unit tests. How did that happen. Must have been in a rush. :-)

Looks like you have a free reign.

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

No branches or pull requests

3 participants