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

Cannot find module error in typescript 4.8.4/yarn berry(pnp) #50990

Closed
ChoSeoHwan opened this issue Sep 29, 2022 · 2 comments
Closed

Cannot find module error in typescript 4.8.4/yarn berry(pnp) #50990

ChoSeoHwan opened this issue Sep 29, 2022 · 2 comments

Comments

@ChoSeoHwan
Copy link

ChoSeoHwan commented Sep 29, 2022

Bug Report

In version 4.8.3, import module works normally,
but from version 4.8.4, an error occurs.

src/index.ts:1:20 - error TS2307: Cannot find module 'moment' or its corresponding type declarations.

1 import moment from "moment";
                     ~~~~~~~~


Found 1 error in src/index.ts:1

🔎 Search Terms

typescript 4.8.4
cannot find module

🕗 Version & Regression Information

Typescript 4.8.4

yarn 3.2.3

⏯ Playground Link

typescript-error repository

How to reporduce

  • typescript 4.8.4 version error case

    1. yarn install
    2. yarn build
    3. error occurred in import module
  • typescript 4.8.3 version

    1. yarn up typescript@4.8.3
    2. yarn build
    3. success to build

💻 Code

import moment from "moment";

const time = moment();

console.log(time.format('YYYY-MM-DD'));

🙁 Actual behavior

Error occurred in import module.

🙂 Expected behavior

It should build normally with no errors.

@ChoSeoHwan ChoSeoHwan changed the title import module error in typescript 4.8.4/yarn berry(pnp) Cannot find module error in typescript 4.8.4/yarn berry(pnp) Sep 29, 2022
@MartinJohns
Copy link
Contributor

Yarn PNP requires specific patches for every released TypeScript version. Make sure you have the latest version of Yarn installed, or wait for Yarn to release support. See also yarnpkg/berry#4915.

@ChoSeoHwan
Copy link
Author

ChoSeoHwan commented Sep 29, 2022

Yarn PNP requires specific patches for every released TypeScript version. Make sure you have the latest version of Yarn installed, or wait for Yarn to release support. See also yarnpkg/berry#4915.

thanks for your comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants