jkhsjdhjs/node-fetch-cookies

Error when using this library from an electron-webpack project

NoahAndrews opened this issue · 4 comments

Build log from electron-webpack:

ERROR in C:/Users/Noah/.../node_modules/node-fetch-cookies/src/cookie-jar.mjs 101:25-27
[1]   Can't import the named export 'promises' from non EcmaScript module (only default export is available)
[1]    @ C:/Users/Noah/.../node_modules/node-fetch-cookies/src/index.mjs

I believe the issue is that node's modules don't use ES6 imports, which causes a problem because of the .mjs extension used by this library, but I'm no expert on how JS modules work.

Hey, thanks for reporting this issue! This library is intended as cookie handler for node-fetch. Since electron is kind of a web browser on its own, it can handle cookies. So why do you want to use this library?

We need to make some HTTP calls from the Node side in order to circumvent the same origin policy.

Do you manually supply file extensions in your electron webpack project? If so, make sure to add mjs there: graphql/graphql-js#1272 (comment)

I don't, but it looks like electron-webpack does. I've opened electron-userland/electron-webpack#398.