Skip to content

Newly created TS plugins cannot install dependencies #10507

Description

@josmas

Check for duplicates

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

Description

Newly created typescript plugins have "typescript": "^7.0.2" in devDependencies which results in two problems:

  1. npm install fails because @blockly/dev-scripts caps TS at ^5
  2. even updating dev-scripts, or installing with --legacy-peer-deps, the ts-loader pacakge does not seem to support version 7 yet (TypeError: Cannot read properties of undefined (reading 'fileExists')).

Reproduction steps

  1. run npx @blockly/create-package plugin my-plugin --type plugin --typescript
  2. see it fail when it tries to install

Priority

There are two issues here, the fact that @blockly-dev-scripts is capping at TS version ^5, and what seems to be a more critical issue which is ts-loader not supporting TS version 7 (I believe the underlying API has changed).

There are two workarounds:

  1. Manually modify devDependencies in package.json to TS ^5
  2. Manually modify devDependencies in package.json to TS ^6 and install with --legacy-peer-deps

A fix could be added to @blockly/dev-create so that it does not output the latest version of TS available and that would help. Another thing that could help would be updating the version in @blockly/dev-scripts to 6, but this would need some testing. Still, none of those would fix the potential incompatibility with TS 7 (through external dependencies - for what I've seen, the ts-loader package).

I'd be happy to do a bit more digging if you can reproduce and are not already on it. Let me know.

Stack trace

> npx @blockly/create-package plugin my-plugin --type plugin --typescript
fatal: not a git repository (or any of the parent directories): .git
Creating a new Blockly plugin with name my-plugin in /private/tmp/bdiff/my-plugin.

Installing packages. This might take a couple of minutes.
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: @blockly/dev-scripts@13.3.0
npm error Found: typescript@7.0.2
npm error node_modules/typescript
npm error   dev typescript@"^7.0.2" from the root project
npm error   peer typescript@">3.6.0" from fork-ts-checker-webpack-plugin@9.1.0
npm error   node_modules/fork-ts-checker-webpack-plugin
npm error     fork-ts-checker-webpack-plugin@"^9.1.0" from @blockly/dev-scripts@13.3.0
npm error     node_modules/@blockly/dev-scripts
npm error       dev @blockly/dev-scripts@"^13.3.0" from the root project
npm error   1 more (ts-loader)
npm error
npm error Could not resolve dependency:
npm error peerOptional typescript@"^4.3.2 || ^5" from @blockly/dev-scripts@13.3.0
npm error node_modules/@blockly/dev-scripts
npm error   dev @blockly/dev-scripts@"^13.3.0" from the root project
npm error
npm error Conflicting peer dependency: typescript@5.9.3
npm error node_modules/typescript
npm error   peerOptional typescript@"^4.3.2 || ^5" from @blockly/dev-scripts@13.3.0
npm error   node_modules/@blockly/dev-scripts
npm error     dev @blockly/dev-scripts@"^13.3.0" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry this command with --force or --legacy-peer-deps to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error //.npm/_logs/2026-09-18T13_52_06_738Z-eresolve-report.txt
npm error A complete log of this run can be found in: //.npm/_logs/2026-09-18T13_52_06_738Z-debug-0.log
node:child_process:1017
    throw err;
    ^

Error: Command failed: cd my-plugin && npm install
    at genericNodeError (node:internal/errors:986:15)
    at wrappedFn (node:internal/errors:540:14)
    at checkExecSyncError (node:child_process:942:11)
    at execSync (node:child_process:1014:15)
    at exports.createPlugin (//.npm/_npx/cff5129890bdc14b/node_modules/@blockly/create-package/bin/plugin.js:193:5)
    at Command.<anonymous> (//.npm/_npx/cff5129890bdc14b/node_modules/@blockly/create-package/bin/create.js:43:5)
    at Command.listener [as _actionHandler] (file:////.npm/_npx/cff5129890bdc14b/node_modules/commander/lib/command.js:569:17)
    at file:////.npm/_npx/cff5129890bdc14b/node_modules/commander/lib/command.js:1616:14
    at Command._chainOrCall (file:////.npm/_npx/cff5129890bdc14b/node_modules/commander/lib/command.js:1500:12)
    at Command._parseCommand (file:////.npm/_npx/cff5129890bdc14b/node_modules/commander/lib/command.js:1615:27) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 88987,
  stdout: null,
  stderr: null
}

Screenshots

No response

Browsers

No response

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: triageIssues awaiting triage by a Blockly team member

    Type

    Projects

    • Status
      Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions