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

[Bug?]: TS 4.9.4 PnP Cannot find module error #5125

Closed
1 task
Dongkyuuuu opened this issue Dec 8, 2022 · 11 comments · Fixed by #5127
Closed
1 task

[Bug?]: TS 4.9.4 PnP Cannot find module error #5125

Dongkyuuuu opened this issue Dec 8, 2022 · 11 comments · Fixed by #5127
Labels
bug Something isn't working upholded Real issues without formal reproduction

Comments

@Dongkyuuuu
Copy link
Contributor

Dongkyuuuu commented Dec 8, 2022

Self-service

  • I'd be willing to implement a fix

Describe the bug

When installing typescript@4.9.4 with yarn@3.3.0 in VSCode, Cannot find module * or its corresponding type declarations. is displayed.

To reproduce

await packageJsonAndInstall({
  dependencies: {
    typescript: '4.9.4',
  },
});

await yarn(`dlx`, `@yarnpkg/sdks`, `vscode`);

Environment

System:
    OS: macOS 12.6
    CPU: (10) arm64 Apple M1 Max
  Binaries:
    Node: 18.12.1 - /private/var/folders/vz/s2tqygkj2rg1xtm390jsldjh0000gn/T/xfs-6dd637d6/node
    Yarn: 3.3.0 - /private/var/folders/vz/s2tqygkj2rg1xtm390jsldjh0000gn/T/xfs-6dd637d6/yarn
    npm: 8.19.2 - ~/.nvm/versions/node/v18.12.1/bin/npm

Additional context

Error still occurs after yarn dlx @yarnpkg/sdks vscode. It worked fine when I used the typescript@4.9.3.

@Dongkyuuuu Dongkyuuuu added the bug Something isn't working label Dec 8, 2022
@merceyz merceyz added the upholded Real issues without formal reproduction label Dec 8, 2022
@merceyz merceyz pinned this issue Dec 8, 2022
@RDIL RDIL changed the title [Bug?]: TS 4.9.4 PnP Cannot find module error in VSCode [Bug?]: TS 4.9.4 PnP Cannot find module error Dec 9, 2022
@stefpb
Copy link

stefpb commented Dec 12, 2022

yarn set version latest
yarn add -D typescript@4.9.4
yarn build

produces still a lots of this errors:

TS2307: Cannot find module 'mitt' or its corresponding type declarations.
    13 | import { createApp, defineComponent } from 'vue';
    14 | import { createPinia } from 'pinia';
  > 15 | import mitt from 'mitt';

What i did wrong? Or is it a different / new issue?

@arcanis
Copy link
Member

arcanis commented Dec 12, 2022

This has been released in a RC, not yet a patch release.

@sorenhoyer
Copy link

You need yarn set version canary for now. Or downgrade to v 4.9.3

@dylanplural
Copy link

Should this be closed?

Considering that the bug is still present outside of the canary branch, took a lot longer to find this issue than would have been the case if it was still open.

@jdpt0
Copy link

jdpt0 commented Dec 19, 2022

I've ran into this exact issue multiple times and yarn is always the last thing to check. So many hours wasted. Is there a better way to handle this type of issue when typescript is updated? A console warning or something would be very handy.

Especially when yarn can fail on patches for typescript.

@michaeljaltamirano
Copy link

Should this be closed?

Considering that the bug is still present outside of the canary branch, took a lot longer to find this issue than would have been the case if it was still open.

+1, I've been checking back on this repo just about every day to see if 3.3.1 has been released.

@arcanis
Copy link
Member

arcanis commented Dec 19, 2022

I'll look at making a release tomorrow.

Is there a better way to handle this type of issue when typescript is updated? A console warning or something would be very handy.

It already warns that the patch failed.

@jdpt0
Copy link

jdpt0 commented Dec 19, 2022

It already warns that the patch failed.

image

This is what I'm getting in my console currently, when upgrading from typescript 4.9.3 to 4.9.4. Apologies if I'm not seeing it, but I can't see an error here?

Is this a caching issue? Prehaps I fetched the patch before the bug was found and reported, so although it cannot be found remotely, I had a local version and Yarn uses that instead?

taehwanno added a commit to taehwanno/taehwannoh.com that referenced this issue Dec 20, 2022
* build: apply yarn pnp

* chore: editor support

* chore: downgrade typescript to 4.9.3 for yarn berry pnp editor support

See: yarnpkg/berry#5125 (comment)

* chore: add missing deps

* build: apply yarn berry zero-install

* ci: re-add yarn installation step

* ci: change install option frozen-lockfile to immutable

* ci: apply immutable-cache option

* chore: add missing deps @next/swc-linux-x64-gnu
@merceyz
Copy link
Member

merceyz commented Dec 20, 2022

v3.3.1 has been released

yarn set version berry
yarn

+1, I've been checking back on this repo just about every day to see if 3.3.1 has been released.

Note that you can watch the repo for releases to get a notification instead.

@michaeljaltamirano
Copy link

v3.3.1 has been released

yarn set version berry
yarn

+1, I've been checking back on this repo just about every day to see if 3.3.1 has been released.

Note that you can watch the repo for releases to get a notification instead.

Thank you for the tip! I've just added myself as a watcher to the repo for releases. 🙏

@m0m0i
Copy link

m0m0i commented Dec 24, 2022

I just hit the error and fixed with the following steps:

  1. yarn set version berry
  2. Create .yarnrc.yml file and add yarnPath: .yarn/releases/yarn-3.3.1.cjs
  3. yarn
  4. Install editor SDK(vscode in my case) with yarn dlx @yarnpkg/sdks vscode
  5. Reload window with command + shift + p then 'Developer: Reload Window'

It worked for me :)

jtbandes added a commit to foxglove/studio that referenced this issue Jan 24, 2023
**User-Facing Changes**
None

**Description**
Attempt to address build failure on #5182. May be related to yarn's
built-in TS patch which was supposedly updated in 3.3.1
(yarnpkg/berry#5146 /
yarnpkg/berry#5125).
@merceyz merceyz unpinned this issue Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upholded Real issues without formal reproduction
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants