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

Blockly won't compile with typescript (at least v8.0.1) #6146

Closed
BeksOmega opened this issue May 6, 2022 · 1 comment
Closed

Blockly won't compile with typescript (at least v8.0.1) #6146

BeksOmega opened this issue May 6, 2022 · 1 comment

Comments

@BeksOmega
Copy link
Collaborator

Describe the bug

If you add Blockly to a typescript project, and attempt to type check it, it will not compile.

To Reproduce

See the steps in the provided repository.

Expected behavior

Blockly's type definitions should allow a project to compile.

Stack Traces

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.

14 import * as Blockly from './core';
                            ~~~~~~~~

node_modules/blockly/core.d.ts:14:13 - error TS2303: Circular definition of import alias 'Blockly'.

14 import * as Blockly from 'blockly';
               ~~~~~~~

node_modules/blockly/core.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.

14 import * as Blockly from 'blockly';
                            ~~~~~~~~~

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

17 import * as Blockly from './core';
                            ~~~~~~~~

node_modules/blockly/javascript.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.

14 import * as Blockly from './core';
                            ~~~~~~~~


Found 5 errors in 4 files.

Errors  Files
     1  node_modules/blockly/blocks.d.ts:14
     2  node_modules/blockly/core.d.ts:14
     1  node_modules/blockly/index.d.ts:17
     1  node_modules/blockly/javascript.d.ts:14

Additional context

Reported by a lovely forum person here.

Changed somewhere between v6 and v8.0.1

@maribethb
Copy link
Contributor

Duplicate of #6079, please follow there for updates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants