Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CommonJS dynamic require is not supported with vite #26

Open
marod424 opened this issue Feb 22, 2022 · 0 comments
Open

CommonJS dynamic require is not supported with vite #26

marod424 opened this issue Feb 22, 2022 · 0 comments

Comments

@marod424
Copy link

In my vite project I am unable to mint an NFT using the ZDK because of the following error:

Error: Dynamic require of "../schemas/zora/20210604.json" is not supported
    at Validator.validate (validator.ts:24:20)
    at Generator.generateJSON (generator.ts:26:33)

At first I considered this a vite issue, but it appears they won't be supporting arbitrary CommonJS deps:
vitejs/vite#162 (comment)

The offending require:

const schema = require(`../schemas/${this.name}/${this.calVer}.json`)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant