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

Error when using this library from an electron-webpack project #10

Open
NoahAndrews opened this issue Aug 4, 2020 · 4 comments
Open

Comments

@NoahAndrews
Copy link

NoahAndrews commented Aug 4, 2020

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.

NoahAndrews pushed a commit to REVrobotics/node-fetch-cookies that referenced this issue Aug 4, 2020
@jkhsjdhjs
Copy link
Owner

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?

@NoahAndrews
Copy link
Author

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

@jkhsjdhjs
Copy link
Owner

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

@NoahAndrews
Copy link
Author

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

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

2 participants