-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with default export in typescript definitions #6079
Comments
I'm having that same problem :( |
Same problem here. |
I have the same problem as well, but got around the issue by specifying https://groups.google.com/g/blockly/c/HCp55c18bQk/m/sLKBCjPHAQAJ |
Hello @FrancescoPandolfi and @joseluiz98 and anyone else experiencing this issue, could you please try blockly beta |
I installed it, upgrading from 7.20211209.5. Prior to the version change, this was working just fine. Not sure if its related, but just thought i'd add. |
@Chappie74 Thanks for testing! Those errors are unfortunately regressions introduced in v8 - I think all of the interface classes got a bit weird. Ultimately this bug was hiding all of the other type declaration regressions since this was preventing any type checking from occurring. Feel free to file a separate bug for that, and in the meantime you can have the compiler ignore the problematic lines :/ sorry about that! The good news is we are on the cusp of converting our whole codebase to TS ourselves so all of these inconsistencies will get a lot more obvious to us and hopefully less likely to occur in the future. Thanks! |
Describe the bug
TypeScript error when importing Blockly types, see stack trace section
To Reproduce
(taken from forum post: https://groups.google.com/g/blockly/c/hFuWPbkXRSk )
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
Stack Traces
Additional context
https://www.typescriptlang.org/tsconfig#esModuleInterop
I think this might go away if in blocks.d.ts we did
import Blockly from 'blockly';
instead ofimport * as Blockly
but I don't fully understand the intricacies of the module system we're using and how that interacts with the various tools being used. I think @cpcallen you are the expert here if this means anything to you.The text was updated successfully, but these errors were encountered: