openapi-snippet icon indicating copy to clipboard operation
openapi-snippet copied to clipboard

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

Open truumahn opened this issue 4 years ago • 5 comments

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/

truumahn avatar Sep 29 '20 14:09 truumahn

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

erunion avatar Oct 06 '20 16:10 erunion

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

ErikWittern avatar Oct 12 '20 09:10 ErikWittern

@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.

erunion avatar Oct 16 '20 03:10 erunion

@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.

ErikWittern avatar Oct 19 '20 09:10 ErikWittern

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

erunion avatar Oct 19 '20 17:10 erunion