Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Issue when using Webpack #52

Closed
Parzival42 opened this issue May 1, 2021 · 1 comment
Closed

Issue when using Webpack #52

Parzival42 opened this issue May 1, 2021 · 1 comment

Comments

@Parzival42
Copy link

Hi!

I am using r6api.js within an electron application (I am using the Vue CLI Plugin Electron Builder). However, it occurred to me that using r6api.js in combination with webpack fails due to:

TypeError: nodeFetch is not a function
    at eval (webpack:///./node_modules/r6api.js/lib/fetch.js?:10:3)

It seems like there is an issue using require together with webpack.
For example quickly changing const nodeFetch = require('node-fetch'); to const nodeFetch = require('node-fetch').default; in /lib/fetch.js solves the issue for me. However, I didn't investigate too much if this may introduce other issues.

You can find some more infos about this problem here:

Is there any chance you could make r6api.js webpack ready?
Thanks in advance!

@danielwerg
Copy link
Owner

Run into this issue myself the other day, using typescript branch myself which is works fine with webpack but obviously can't recommend you that because of breaking changes. Keep doing that you doing if it's works, will try to merge typescript branch after realese of North Star

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants