Skip to content
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

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

Closed
1 task done
clementcontet opened this issue Mar 19, 2024 · 4 comments · Fixed by #7955
Closed
1 task done

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

clementcontet opened this issue Mar 19, 2024 · 4 comments · Fixed by #7955
Assignees
Labels
issue: bug Describes why the code or behaviour is wrong

Comments

@clementcontet
Copy link
Contributor

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

@clementcontet clementcontet added issue: bug Describes why the code or behaviour is wrong issue: triage Issues awaiting triage by a Blockly team member labels Mar 19, 2024
@maribethb
Copy link
Contributor

Thank you for reporting!

@maribethb maribethb removed the issue: triage Issues awaiting triage by a Blockly team member label Mar 20, 2024
@cpcallen
Copy link
Contributor

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?

@clementcontet
Copy link
Contributor Author

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';

cpcallen added a commit to cpcallen/blockly that referenced this issue Mar 21, 2024
Fixes google#7952.

The main typings file for langfiles, typings/msg/msg.d.ts, was
inadvertently deleted in PR google#7822.

This was part of a well intentioned attempt to remove spurious
files from typings/msg/ that do not correspond to published
langfiles, but this file should have been retained because
msg.d.ts is reexported by all the other *.d.ts files in this
directory.
cpcallen added a commit that referenced this issue Mar 21, 2024
…dd TS import test (#7955)

* test(typings): Add langfile (msg) import + typings test

* fix(typings): Restore inadvertently-deleted typings/msg/msg.d.ts

  Fixes #7952.

  The main typings file for langfiles, typings/msg/msg.d.ts, was
  inadvertently deleted in PR #7822.

  This was part of a well intentioned attempt to remove spurious
  files from typings/msg/ that do not correspond to published
  langfiles, but this file should have been retained because
  msg.d.ts is reexported by all the other *.d.ts files in this
  directory.
@cpcallen
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Describes why the code or behaviour is wrong
Projects
None yet
3 participants