Skip to content

Have trouble using plugin in typescript project #38

@chi-w-ng

Description

@chi-w-ng

I encountered a 'could not resolve module' error while using it in a TypeScript project.
To replicate this issue, you can follow these steps:

Start with the Blockly TypeScript sample from:
https://github.com/google/blockly-samples/tree/master/examples/sample-app-ts

Change the tsconfig.json content to:

{
"compilerOptions": {
"baseUrl": "./",
"outDir": "dist",
"declaration": true,
"declarationMap": true,
"module": "ES2015",
"moduleResolution": "node",
"target": "ES2015",
"strict": false,
"sourceMap": true,
"allowJs": true
},
"include": ["desc.d.ts"]
}

Here is the desc.d.ts content that I add to the project root:

declare module "@mit-app-inventor/blockly-block-lexical-variables"

Add the plugin to index.ts of the blockly sample ts project. Build the project will error.

Is there a way to resolve this issue?

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions