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

fix typescript version error

Open guilhermegregio opened this issue 1 year ago • 6 comments

Solve 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".

Issue: #377

guilhermegregio avatar May 11 '23 12:05 guilhermegregio

🦋 Changeset detected

Latest commit: e3502c94369b4cd0ab0ae2c1d99b250622940f57

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
webpack-config-single-spa-ts Patch
webpack-config-single-spa-react-ts Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar May 11 '23 12:05 changeset-bot[bot]

solved: error of builds @TheMcMurder, i saw i do not run tests locale and not create changes on lock file causing the build errors, verify again please

guilhermegregio avatar May 11 '23 12:05 guilhermegregio

Change looks good. Could someone take a look to it, please? @joeldenning, maybe? Thanks

adripanico avatar Jul 02 '24 13:07 adripanico

I tested this out locally and it didn't seem to fix the issue. However, I'm not sure because create-single-spa uses pnpm and the issue might be yarn-specific. I tried yarn linking the create-single-spa package, which might not be the same as if it were published to npm and installed that way.

Without confidence that the issue is fixed, I can't merge. webpack-config-single-spa-ts has a dependency on fork-ts-checker-webpack-plugin, which has a peerDependency on typescript, so I'm not sure whether moving typescript to devDependencies is the right thing to do.

joeldenning avatar Sep 23 '24 02:09 joeldenning

@joeldenning As far as I can see, webpack-config-single-spa-ts do have Typescript as peerDependency as well. So, at the end of the day, this change is just propagating the peerDepedency from fork-ts-checker-webpack-plugin to webpack-config-single-spa-ts and this one to the final app using it, right?

adripanico avatar Sep 23 '24 06:09 adripanico

The functionality of peerDependencies has changed so much and varies from package manager to package manager - I'm not sure what the correct approach is. Some have advocated for removing peerDependencies entirely because of how problematic they are.

Before merging, verifying that the change fixes the bug is required. I tried modifying webpack-config-single-spa-ts' package.json directly in node_modules and also yarn linking, and neither approach eliminated the error. Both of those approaches might not be equivalent to publishing to npm (linking notoriously is weird, and it's possible for package managers to reinstate the package.json during install), but I'm not sure how else to test it. Recommendations for how to verify the fix appreciated 🙏

joeldenning avatar Sep 23 '24 18:09 joeldenning