Navigation Menu

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

Cannot find module: 'isomorphic-form-data' in swagger-ui-react #7436

Closed
AlexKutkanych opened this issue Jul 27, 2021 · 4 comments
Closed

Cannot find module: 'isomorphic-form-data' in swagger-ui-react #7436

AlexKutkanych opened this issue Jul 27, 2021 · 4 comments

Comments

@AlexKutkanych
Copy link

Q&A (please complete the following information)

  • OS: Win 10
  • Browser: Chrome
  • Version: 91.0.4472.164
  • Method of installation: npm
  • Swagger-UI version: 3.51.1

Describe the bug you're encountering

When running npm run build we ran into a problem with swagger-ui-react package. The error occured in swagger-ui.js - Cannot find module: 'isomorphic-form-data'. Make sure this package is installed.

isomorphic-form-data package is not in node_modules.

Expected behavior

npm run build runs without errors.

Screenshots

image

Additional context or thoughts

When I install isomorphic-form-data package into my project, build works fine.

@emanb29
Copy link

emanb29 commented Jul 27, 2021

If I understand correctly, this seems to have been introduced by the dependency change in swagger-api/swagger-js#2154

@kaisawind
Copy link

any way to fixed it right now?

@char0n
Copy link
Member

char0n commented Jul 28, 2021

You're absolutely right and thanks for reporting this. The problem is in swagger-ui-react build fragments. It contains build fragments that reference the isomorphic-form-data in lazy way. As every build on CI of swagger-ui-react will download latest version of swagger-client, which now doesn't require isomorphic-form-data and thus don't install it. We need to fix how we expose build fragments for swagger-ui-react so that this doesn't happen in future. On Thursday 29.7.2021 there will a new release of swagger-ui-react that will fix this issue automatically by updating to it.

The workaround mentioned in this issue, must be implemented (adding isomorphic-form-data in package.json) before the new release of swagger-ui-react is available.

Update:

Problem can be solved as well by pinning swagger-client to a particular version before v3.14.0 in you package.json file and using webpack alias to use this pinned version. But that is a more complicated approach than just installing isomorphic-form-data.

Gozala added a commit to nftstorage/nft.storage that referenced this issue Jul 28, 2021
Gozala added a commit to nftstorage/nft.storage that referenced this issue Jul 28, 2021
char0n added a commit that referenced this issue Jul 30, 2021
char0n added a commit that referenced this issue Jul 30, 2021
This sets minimum Node.js version to >=12.4 and
fixes problem with swagger-ui.js build fragment.

Refs #7436
@char0n
Copy link
Member

char0n commented Jul 30, 2021

Fixed in https://github.com/swagger-api/swagger-ui/releases/tag/v3.51.2

@char0n char0n closed this as completed Jul 30, 2021
char0n added a commit to swagger-api/swagger-editor that referenced this issue Jul 30, 2021
char0n added a commit to swagger-api/swagger-editor that referenced this issue Jul 30, 2021
char0n added a commit that referenced this issue Jul 30, 2021
char0n added a commit that referenced this issue Jul 30, 2021
char0n added a commit that referenced this issue Jul 30, 2021
char0n added a commit that referenced this issue Jul 30, 2021
char0n added a commit that referenced this issue Aug 11, 2021
char0n added a commit that referenced this issue Sep 10, 2021
char0n added a commit that referenced this issue Sep 13, 2021
char0n added a commit that referenced this issue Sep 13, 2021
char0n added a commit that referenced this issue Sep 15, 2021
char0n added a commit that referenced this issue Sep 20, 2021
char0n added a commit that referenced this issue Oct 8, 2021
char0n added a commit that referenced this issue Oct 12, 2021
char0n added a commit that referenced this issue Oct 22, 2021
char0n added a commit that referenced this issue Nov 2, 2021
char0n added a commit that referenced this issue Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants