Skip to content

ESM build of json-schema-tree has breaking call to require #22

@patrickshipe

Description

@patrickshipe

In the ESM build of this module there is a call to require that originates here:

const resolveAllOf = require('@stoplight/json-schema-merge-allof');

In an ES module, there is no require unless it is created with createRequire, causing this module to not be usable as ESM.

Context

The bug prevents the ESM code from being used. I override with the CJS code for now.

Current Behavior

ESM cannot be used.

Expected Behavior

ESM should be usable.

Possible Workaround/Solution

Use CJS version for now.

Steps to Reproduce

Import ESM build as ESM

Environment

Chrome 115, built using Vite

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions