google/blockly

11.0.0-beta.4 can't import languages in TypeScript

Closed this issue · 4 comments

Check for duplicates

  • I have searched for similar issues before opening a new one.

Description

Hi, with 11.0.0-beta.4, I can't import languages anymore in my TypeScript app:

Error: node_modules/blockly/msg/fr.d.ts:7:15 - error TS2307: Cannot find module './msg' or its corresponding type declarations.
7 export * from './msg';

Reproduction steps

No response

Stack trace

No response

Screenshots

No response

Browsers

Chrome desktop

Thank you for reporting!

Hi @clementcontet, thanks for the report. Can you give us the steps to reproduce? In particular: what import statement triggered this? What tool, and how was it configured?

Hi, sure!
Maybe the easiest is to clone https://github.com/Orange-OpenSource/super-coding-ball/tree/blockly11 and try to run the project.
The imports are in supported-languages-service.ts in the form import Fr from 'blockly/msg/fr';

The fix took slightly longer than expected because my initial guess was that the problem was that the msg/??.d.ts files that

export * from './msg';

should instead have used the full file name

export * from './msg.d.ts';

and I was wondering why this hadn't been a problem in Blockly v9 or v10—but of course I soon discovered that the problem was much simpler: I'd accidentally deleted msg.d.ts in PR #7822 (commit ba97923, in particular).

Thanks @clementcontet for reporting it so quickly.