Skip to content

Commit 6796b8c

Browse files
feat(jco): error on attempt to set async imports for sync transpile
1 parent a1aba1f commit 6796b8c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/jco/src/cmd/transpile.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@ export async function transpileComponent(component, opts = {}) {
179179
'async exports cannot be specified in sync mode (consider adding --async-mode=jspi)'
180180
);
181181
}
182+
if (asyncMode === 'sync' && asyncImports.size > 0) {
183+
throw new Error(
184+
'async imports cannot be specified in sync mode (consider adding --async-mode=jspi)'
185+
);
186+
}
182187
let asyncModeObj;
183188
if (asyncMode === 'sync') {
184189
asyncModeObj = null;

0 commit comments

Comments
 (0)