node-formidable / formidable

The most used, flexible, fast and streaming parser for multipart form data. Supports uploading to serverless environments, AWS S3, Azure, GCP or the filesystem. Used in production.
MIT License
7k stars 680 forks source link

Cannot find module xxx/plugins/octetstream.js #898

Closed alexstyl closed 1 year ago

alexstyl commented 1 year ago

I am building an electron app that hosts an http server. I am using formidable to receive incoming files.

Whenever my app receives a POST request I am seeing the following exception in the stacktrace:

(node:39275) UnhandledPromiseRejectionWarning: Error: Cannot find module '/path/to/project/.webpack/main/plugins/octetstream.js'
    at webpackEmptyContext (/path/to/project/.webpack/main/index.js:49428:10)
    at /path/to/project/.webpack/main/index.js:47655:83
    at Array.forEach (<anonymous>)
    at new IncomingForm (/path/to/project/.webpack/main/index.js:47652:33)

I am new to webpack so I am not sure what kind of rule i need to setup to make this work. Any pointers are welcome.

I found https://github.com/node-formidable/formidable/issues/883 but the issue was closed without any pointers.

alexstyl commented 1 year ago

Fixed. This had nothing to do with Webpack.

I ended up updating Formidable (from 2.x.x. to 3.x.x) and electron (from 13.x.x to 21.x.x) and it worked.