在StencilJs中,我在组件中导入了鞋带库,如下所示:
import module from '@shoelace-style/shoelace/dist/components/card/card';
if (!customElements.get('sl-card')) customElements.define('sl-card', module);在测试中,我得到了一个错误:
SyntaxError:无法在模块之外使用导入语句.
你知道为什么鞋带部件在开玩笑时会造成这个错误吗?
发布于 2021-10-19 14:35:08
你需要启用ESM。Jest有实验支撑,但您需要选择它:
https://stackoverflow.com/questions/67859182
复制相似问题