Closed dav-is closed 5 months ago
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.
fs/promises
10.1.0
10.0.1
In 10.0.1, this library uses fs: https://github.com/APIDevTools/json-schema-ref-parser/blob/12cb26a764b975de38143458d06972772609be76/lib/resolvers/file.js#L1
fs
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
package.json
browser
false
I think fs/promises should be included in there instead.
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+
The browser is trying to require
fs/promises
in Next.js, failing to compile when using10.1.0
. Rolling back to10.0.1
seems to fix it.In
10.0.1
, this library usesfs
: https://github.com/APIDevTools/json-schema-ref-parser/blob/12cb26a764b975de38143458d06972772609be76/lib/resolvers/file.js#L1In
10.1.0
, this library usesfs/promises
: https://github.com/APIDevTools/json-schema-ref-parser/blob/a5b3946fbb62683ab69e3747a8893014591726af/lib/resolvers/file.ts#L1In
package.json
,fs
is marked inbrowser
asfalse
: https://github.com/APIDevTools/json-schema-ref-parser/blob/a5b3946fbb62683ab69e3747a8893014591726af/package.json#L46-L48I think
fs/promises
should be included in there instead.