Skip to content

Node 10+ compatibility issue #12

@athrawes

Description

@athrawes

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions