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

formidable 2.0.1 has some wrong #224

Closed
3 tasks done
RookieGz opened this issue Jan 5, 2023 · 4 comments
Closed
3 tasks done

formidable 2.0.1 has some wrong #224

RookieGz opened this issue Jan 5, 2023 · 4 comments
Labels

Comments

@RookieGz
Copy link

RookieGz commented Jan 5, 2023

Describe the bug

截屏2023-01-05 14 59 40

Node.js version: v16.19.0

OS version: macOS Ventura 13.1

Description:

i try to package a nodejs app with webpack5, but when the app running has a error:

hexoid is not a function

I notice has a formidable 2.0.1, Maybe it's a bug with this package

formidable 2.0.1

Actual behavior

Expected behavior

Code to reproduce

Checklist

  • I have searched through GitHub issues for similar issues.
  • I have completely read through the README and documentation.
  • I have tested my code with the latest version of Node.js and this package and confirmed it is still not working.
@RookieGz RookieGz added the bug label Jan 5, 2023
@RookieGz
Copy link
Author

RookieGz commented Jan 5, 2023

If I'm wrong please close this issue

@RookieGz RookieGz closed this as completed Jan 5, 2023
@wxfred
Copy link

wxfred commented Feb 20, 2023

Any solution, pls?

@RookieGz
Copy link
Author

@wxfred add this code in webpack.config.js
plugins: [ new NormalModuleReplacementPlugin( /^hexoid$/, require.resolve("hexoid/dist/index.js") ), ],

@wxfred
Copy link

wxfred commented Mar 7, 2023

@wxfred add this code in webpack.config.js plugins: [ new NormalModuleReplacementPlugin( /^hexoid$/, require.resolve("hexoid/dist/index.js") ), ],

Not work for me, but really helpful to locate the problem -- webpack5 uses hexoid/dist/index.mjs by default while formidable uses it as a CommonJS module. I'm using vue-cli-plugin-electron-builder, finally, i found a work around
in vue.config.js

module.exports = {
  pluginOptions: {
    electronBuilder: {
      chainWebpackMainProcess(config) {
        config.resolve.alias
          .set('hexoid', 'hexoid/dist/index.js')

Thanks a lot.

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

No branches or pull requests

2 participants