johnagan/crx-webpack-plugin

Node 10+ compatibility issue

athrawes opened this issue · 1 comments

Hi!
While using this plugin with Node 10+, I get this error:

fs.js:135
  throw new ERR_INVALID_CALLBACK();
  ^

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
    at maybeCallback (fs.js:135:9)
    at Object.writeFile (fs.js:1181:14)
    at $PROJECT/node_modules/crx-webpack-plugin/index.js:54:12
    at $PROJECT/node_modules/mkdirp/index.js:30:20
    at FSReqCallback.args [as oncomplete] (fs.js:147:20)

It appears that as of Node 10, fs.writeFile() now requires a callback function:
https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback

It looks like if this call is switched to fs.writeFileSync() or a dummy callback is added, this should work again.

shiny commented

@johnagan
HALLO? ANY BODY?
please merge #8

image