create-single-spa icon indicating copy to clipboard operation
create-single-spa copied to clipboard

Error typescript version dependency

Open guilhermegregio opened this issue 1 year ago • 9 comments

Reproduce

Install a new version of typescript and install package webpack-config-single-spa-ts

Error

error An unexpected error occurred: "could not find a copy of typescript to link in /app/node_modules/webpack-config-single-spa-ts/node_modules".

guilhermegregio avatar May 08 '23 19:05 guilhermegregio

Posible solution

Remove typescript of dependencies from package webpack-config-single-spa-ts

guilhermegregio avatar May 08 '23 19:05 guilhermegregio

As @guilhermegregio states, I don't think neither webpack-config-single-spa-ts nor webpack-config-single-spa-react-ts actually require having TypeScript as dependency. For the moment, we have decided to add both configurations to our project (manually adding both JS config files), removing such dependencies and adding fork-ts-checker-webpack-plugin. This way we have been able to properly bump TS to latest version and everything is working as expected.

adripanico avatar Aug 02 '23 12:08 adripanico

Hello, any updates on this issue?

Gedzis avatar Jun 10 '24 08:06 Gedzis

Same problem here =/

ValchanOficial avatar Aug 15 '24 17:08 ValchanOficial

I will take a look at this over the weekend.

MilanKovacic avatar Aug 15 '24 22:08 MilanKovacic

Same here with [email protected] as a devDependency on my project. If I downgrade to typescript 4 or lower, the error is gone, but my project can't use lower than 5.

ludeviance avatar Aug 16 '24 18:08 ludeviance

I was unable to reproduce the issue by creating a new root config / application, and upgrading to the latest typescript 5 version. I suspect the problem is the declaration of typescript in both dependencies, and peer dependencies in the webpack-config-single-spa-ts package.

Can you please specify which package manager you are using, and post a small reproduction repository?

MilanKovacic avatar Aug 16 '24 20:08 MilanKovacic

Hello, I tried to reproduce and still exists. Steps to reproduce:

  1. Create new single-spa root config project with yarn create single-spa
  2. Update dependencies to:
  • "single-spa": "^6.0.2",
  • "single-spa-layout": "^2.2.0"
  1. Run yarn install
  2. Upgrade typescript dependency to "typescript": "^5.6.2",
  3. Run yarn install and error is error Invariant Violation: could not find a copy of typescript to link in

Gedzis avatar Sep 20 '24 06:09 Gedzis

I am able to replicate the issue following those steps. Note that pnpm doesn't seem to have the same issue, so perhaps it is yarn-specific.

joeldenning avatar Sep 22 '24 23:09 joeldenning