json-schema-ref-parser
json-schema-ref-parser copied to clipboard
Browser is trying to require `fs/promises`
The browser is trying to require fs/promises
in Next.js, failing to compile when using 10.1.0
. Rolling back to 10.0.1
seems to fix it.
In 10.0.1
, this library uses fs
:
https://github.com/APIDevTools/json-schema-ref-parser/blob/12cb26a764b975de38143458d06972772609be76/lib/resolvers/file.js#L1
In 10.1.0
, this library uses fs/promises
:
https://github.com/APIDevTools/json-schema-ref-parser/blob/a5b3946fbb62683ab69e3747a8893014591726af/lib/resolvers/file.ts#L1
In package.json
, fs
is marked in browser
as false
:
https://github.com/APIDevTools/json-schema-ref-parser/blob/a5b3946fbb62683ab69e3747a8893014591726af/package.json#L46-L48
I think fs/promises
should be included in there instead.
I am getting the same error. Is there a workaround?
I am getting the same error. Is there a workaround?
I had to downgrade to 10.0.1 and I don't use the fs resolver
This is fixed in v11+