You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched for similar issues before opening a new one.
Description
I can't figure out how to import generators with the new types in TypeScript.
Reproduction steps
If I keep the imports from the current implementation (with Blockly 10):
import {javascriptGenerator, JavascriptGenerator, Order} from 'blockly/javascript';
I get Error: node_modules/blockly/javascript.d.ts:7:15 - error TS2307: Cannot find module 'generators/javascript' or its corresponding type declarations.
If I try to fix the imports:
import {javascriptGenerator, JavascriptGenerator, Order} from 'blockly/generators/javascript';
I get Error: Module not found: Error: Can't resolve 'blockly/generators/javascript'
To fix the compilation, I had to keep the original imports and modify node_modules/blockly/javascript.d.ts
from export * from 'generators/javascript';
to export * from './generators/javascript';
Stack trace
No response
Screenshots
No response
Browsers
No response
The text was updated successfully, but these errors were encountered:
* test(generators): Add generator TS import/use tests
* fix(generators): Fix generator type declarations
Add a missing ./ prefix to the imports in the generator wrapper
.d.ts files.
Fixes: #7741
Check for duplicates
Description
I can't figure out how to import generators with the new types in TypeScript.
Reproduction steps
If I keep the imports from the current implementation (with Blockly 10):
import {javascriptGenerator, JavascriptGenerator, Order} from 'blockly/javascript';
Error: node_modules/blockly/javascript.d.ts:7:15 - error TS2307: Cannot find module 'generators/javascript' or its corresponding type declarations.
If I try to fix the imports:
import {javascriptGenerator, JavascriptGenerator, Order} from 'blockly/generators/javascript';
Error: Module not found: Error: Can't resolve 'blockly/generators/javascript'
To fix the compilation, I had to keep the original imports and modify
node_modules/blockly/javascript.d.ts
export * from 'generators/javascript';
export * from './generators/javascript';
Stack trace
No response
Screenshots
No response
Browsers
No response
The text was updated successfully, but these errors were encountered: