ErikWittern / openapi-snippet

Generates code snippets for given Swagger / Open API documents
MIT License
120 stars 67 forks source link

ERROR in ./node_modules/form-data/lib/form_data.js Module not found: Error: Can't resolve 'fs' #52

Open truumahn opened 4 years ago

truumahn commented 4 years ago

Log:

ERROR in ./node_modules/form-data/lib/form_data.js
Module not found: Error: Can't resolve 'fs' in '/path/to/ptoject/node_modules/form-data/lib'
 @ ./node_modules/form-data/lib/form_data.js 7:9-22
 @ ./node_modules/openapi-snippet/node_modules/httpsnippet/src/index.js
 @ ./node_modules/openapi-snippet/index.js

Explanation:

A recent change in the httpsnippet package - introduced in v1.23.0 - broke builds when using openapi-snippet.

Workaround:

Force openapi-snippet to use the 1.22.0 version. With yarn: https://classic.yarnpkg.com/en/docs/selective-version-resolutions/

erunion commented 4 years ago

Sorry about that, I've just submitted a fix in https://github.com/Kong/httpsnippet/pull/184.

ErikWittern commented 4 years ago

@erunion nice to see this fixed. Is a patch planned to distribute the fix?

erunion commented 4 years ago

@ErikWittern I don't manage or use this project but a new release of HTTPSnippet was pushed out with my fix for this issue so it should be able to be pulled in here to resolve the problem.

ErikWittern commented 4 years ago

@erunion Thanks for the information!

The original author of this issue, @truumahn, states that the issue was

introduced in v1.23.0

Given that this is still the latest released version as of now (see npm and GitHub), I will hold off with updating the dependency until the new version is released.

erunion commented 4 years ago

Sorry yeah you're right. My fix for this is in https://github.com/Kong/httpsnippet/commit/0fc7f4a42cafadf00d1f2c0463ac93f9a8e7258b which hasn't been released yet.