-
I try to import konva in my Shopify Hydrogen project but have an issue:
Shopify Hydrogen no has dynamic import. Does anybody has the cause or solution? |
Beta Was this translation helpful? Give feedback.
Answered by
frehner
Aug 15, 2022
Replies: 1 comment 1 reply
-
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. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
phongpv
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Or see if konva has a CJS build and use that.