-
Notifications
You must be signed in to change notification settings - Fork 286
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
Node.js - realFetch.call is not a function #194
Comments
facing the same problem |
tested on version 2.2.1 and version 3.0.0 and I can confirm it is not happening on version 2.2.1, only on version 3.0.0 |
I think it's a bug from I guess you may in a isomorphic case, if so try to indicate webpack that module.exports = {
// ...
externals: {
'node-fetch': 'commonjs2 node-fetch',
}
}; |
I ended up switching to |
Same issue here. We've switched to FYI we've made it work with module.exports = {
// ...
resolve: {
// ...
mainFields: ['main', 'module']
}
} With our We've also tried to made it per-dependency for both module.exports = {
// ...
resolve: {
// ...
byDependency: {
'node-fetch': {
mainFields: ['main', 'module']
},
'isomorphic-fetch': {
mainFields: ['main', 'module']
}
}
}
} |
Now that NodeJS have built in fetch in v18+ then i think you should be using it instead. now more dependency is needed any more. |
got it working using webpack alias alias: {
'node-fetch': path.join(
cwd,
'../../node_modules/node-fetch/lib/index.js',
),
}, |
Just FYI for anyone else running into this, module.exports = {
// ...
externals: {
'node-fetch': 'node-commonjs node-fetch',
}
}; |
Trying to use this in a node.js worker and seeing error
realFetch.call is not a function
The text was updated successfully, but these errors were encountered: