Skip to content

Dynamic import "Konva" in Shopify Hydrogen #1936

Answered by frehner
phongpv asked this question in Help
Discussion options

You must be logged in to vote

I believe you see this because Hydrogen is being used as a CommonJS module, and you're trying to import an ESM-only package.

As noted in the message, one way to work around this is to do a dynamic import

- import konva from 'konva'
+ const konva = import('konva')

Or see if konva has a CJS build and use that.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@phongpv
Comment options

Answer selected by phongpv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants