hyperjump-io / json-schema

JSON Schema Validation, Annotation, and Bundling. Supports Draft 04, 06, 07, 2019-09, 2020-12, OpenAPI 3.0, and OpenAPI 3.1
https://json-schema.hyperjump.io/
MIT License
221 stars 21 forks source link

Could not resolve "@hyperjump/browser" after upgrading from 1.6.7 to 1.7.1 #47

Closed xhuberdeau closed 9 months ago

xhuberdeau commented 9 months ago

Hello,

Thanks for this repo :slightly_smiling_face:.

As the title says, after upgrading from 1.6.7 to 1.7.1, I get the error Could not resolve "@hyperjump/browser" when building my node backend app with esbuild. Is it expected?

Thanks.

jdesrosiers commented 9 months ago

In 1.7.0, some of the functionality in @hyperjump/json-schema was extracted into a component that can be reused for other purposes. That new component is @hyperjump/browser. @hyperjump/browser is included in package.json as a peer dependency. Perhaps esbuild is handling peer dependencies in an unexpected way? I'll look into it.

jdesrosiers commented 9 months ago

It looks like esbuild works fine. Are you using yarn? After some poking around, I found out that yarn doesn't install peer dependencies automatically like npm. So if you're using yarn, you'll need to add @hyperjump/browser to your package.json.

xhuberdeau commented 9 months ago

Hello, yes I'm using yarn. Thanks for your fast reply :slightly_smiling_face: