allowSyntheticDefaultImports

844 views
Skip to first unread message

John Duffy

unread,
Apr 15, 2022, 8:05:08 AM4/15/22
to Blockly
Hi,
Thanks for the great product.
The recent release, I get the error below.  I also set allowSyntheticDefaultImports: true in tsconfig.json.
To reproduce:
ng new ws --create-application=true --routing=false --style=scss;
cd ws;
npm install blockly;
ng g c test
sed -i "2i import Blockly from 'blockly';" src/app/test/test.component.ts
ng serve

 node_modules/blockly/blocks.d.ts:14:26 - error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'allowSyntheticDefaultImports' flag and referencing its default export.

import * as Blockly from './core';

Maribeth Bottorff

unread,
Apr 16, 2022, 4:32:33 PM4/16/22
to Blockly
Hello, Thanks for bringing this up. I have created an issue for this here: https://github.com/google/blockly/issues/6079

In the meantime, it seems like this error only affects the type checking, not the actual use of blockly (the error is with the definition file and not the actual code dependency). I know that isn't ideal but you may be able to disable or ignore this error for now to unblock you while we work on this issue.

John Duffy

unread,
Apr 16, 2022, 6:00:12 PM4/16/22
to Blockly
Hi,
Thanks, I'm continuing using the previous version for now.

Reply all
Reply to author
Forward
0 new messages