-
Notifications
You must be signed in to change notification settings - Fork 402
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
Formidable / Superagent Build Issue With Nextjs & Typescript #352
Comments
Hi, Till the time we get updated superagent, Can you give it a try with overriding formidable dependency version and let us know how it goes with it. In order to override deps, you need to update {
"overrides": {
"pubnub": {
"superagent": {
"formidable": "^3.5.1"
}
}
}
} more info on overrides field is mentioned here It should be valid for |
Hi @mohitpubnub, thank you for getting back to me on this. I made the change you suggested, and here's the updated package-lock.json contents to reflect it:
I am still getting an error in building with a TypeError of a function not defined. This is also the compilation result in case that's helpful:
This is similar to what was happening previously with Formidable v2. Would you happen to have any other recommendations of things to consider? Thanks! |
So I investigated further on this, The problem is that formidable v3 is ESM-only and to upgrade the version of formidable, superagent needs some more stuff to work upon. If I find something working that can unblock this, I'll post here! |
We are also seeing this issue, and it's a major concern. We need to upgrade due to security vulnerabilities in earlier versions with vm2. Our issue comes from an electron app, which uses typescript and webpack. |
@sbeleidy so webpack isn't able to resolve one dependency. Can you give it a try with below changes to const { NormalModuleReplacementPlugin } = require('webpack');
module.exports = {
webpack: (
config,
{ isServer }
) => {
...
if (!isServer) {
config.resolve.fallback.fs = false;
config.resolve.fallback.dns = false;
config.resolve.fallback.net = false;
}
config.plugins.push(
new NormalModuleReplacementPlugin(
/^hexoid$/,
require.resolve('hexoid/dist/index.js')
)
);
return config;
},
} It's working in my case. (next 14.0.4) |
@jazpearson What's exact error your app is facing? Can you update your app's webpack configuration similar to nextjs app?Is it with react/vue ? |
So In general, If webpack is not able to resolve configureWebpack: {
...
resolve: {
...
alias: {
hexoid: 'hexoid/dist/index.js'
},
...
}
...
} |
The error was the same - I've been able to reproduce in a simple electron.js application, and then get it working with |
Thanks @mohitpubnub, that seems to work for me! I appreciate your help. |
Hi,
I am unable to build my nextjs application that uses PubNub. This seems to be due to an issue with the Formidable library (node-formidable/formidable#960) which is a dependency of superagent. Superagent seems to be aware of this issue as well (ladjs/superagent#1786).
The error I am getting is
When I run
npm why formidable
, I get:Would you happen to have any recommendations on how I can build my application in the meantime?
Thank you for your time.
The text was updated successfully, but these errors were encountered: