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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: @babel/types cannot find @babel/traverse error since 7.18.6 #14705

Closed
1 task
aomarks opened this issue Jun 28, 2022 · 2 comments
Closed
1 task

[Bug]: @babel/types cannot find @babel/traverse error since 7.18.6 #14705

aomarks opened this issue Jun 28, 2022 · 2 comments
Labels
area: typescript i: bug i: regression outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: types

Comments

@aomarks
Copy link

aomarks commented Jun 28, 2022

馃捇

  • Would you like to work on a fix?

How are you using Babel?

Other (Next.js, Gatsby, vue-cli, ...)

Input code

mkdir babel-types-error-repro
cd babel-types-error-repro
npm init --force
npm i @babel/types@7.18.6 typescript@4.7.4
echo "import {BlockStatement} from '@babel/types'" > index.ts
echo '{"compilerOptions":{"moduleResolution":"node","strict":true}}' > tsconfig.json
npx tsc

Configuration file name

No response

Configuration

No response

Current and expected behavior

Currently errors with:

node_modules/@babel/types/lib/index.d.ts:1:23 - error TS2307: Cannot find module '@babel/traverse' or its corresponding type declarations.

1 import { Scope } from '@babel/traverse';
                        ~~~~~~~~~~~~~~~~~


Found 1 error in node_modules/@babel/types/lib/index.d.ts:1

Expected: No error.

Environment

  • Node: v16.15.0
  • npm: 8.11.0
  • @babel/types: v7.18.6
  • OS: Ubuntu Linux 20.04
  • Monorepo: no

Possible solution

No response

Additional context

This was a regression between @babel/types@7.18.4 and @babel/types@7.18.6.

Running the following in the above repro directly removes the error:

npm i @babel/types@7.18.4
npx tsc
@babel-bot
Copy link
Collaborator

Hey @aomarks! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite.

@nicolo-ribaudo
Copy link
Member

Fixed by #14706

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Sep 28, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: typescript i: bug i: regression outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: types
Projects
None yet
Development

No branches or pull requests

4 participants