fix: Add missing dependency @babel/types#9924
Conversation
This fixes an issue where '@babel/types' cannot be resolved when using
strict package managers like pnpm, e.g.
/path/to/project/node_modules/.registry.npmjs.org/@babel/parser/7.4.4/node_modules/@babel/parser/typings/babel-parser.d.ts
ERROR in /path/to/project/node_modules/.registry.npmjs.org/@babel/parser/7.4.4/node_modules/@babel/parser/typings/babel-parser.d.ts(11,71):
TS2307: Cannot find module '@babel/types'.
> Build error occurred
Error: > Build failed because of webpack errors
at Object.build [as default] (/path/to/project/node_modules/.registry.npmjs.org/next/8.1.0_react-dom@16.8.6+react@16.8.6/node_modules/next/dist/build/index.js:192:15)
|
Hmm, I don't think this is the right fix. The only place in the parser that uses |
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/10748/ |
|
TypeScript depends on npm to install dependencies for type declarations, as described on https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#dependencies:
Although I have noticed that babel-parser.d.ts is the only declaration file in the babel repo. Maybe it makes sense to move it over to https://github.com/DefinitelyTyped/DefinitelyTyped? |
This fixes an issue where '@babel/types' cannot be resolved when using
strict package managers like pnpm, e.g.