Skip to content

@babel/types is missing for Lib building with typescript suppport #8917

Closed as not planned
@albertlast

Description

@albertlast

Vue version

3.3.4

Link to minimal reproduction

https://github.com/albertlast/vueLibTypeBug

Steps to reproduce

clone the repo, npm run build
Get the error messages

node_modules/@babel/parser/typings/babel-parser.d.ts:3:31 - error TS2307: Cannot find module '@babel/types' or its corresponding type declarations.

3 import * as _babel_types from '@babel/types';
                                ~~~~~~~~~~~~~~

node_modules/@vue/compiler-core/dist/compiler-core.d.ts:3:115 - error TS2307: Cannot find module '@babel/types' or its corresponding type declarations.

3 import { Node as Node$1, Identifier, Function, BlockStatement as BlockStatement$1, Program, ObjectProperty } from '@babel/types';

Notice that the @babel/types is not part of packages-lock.json is.

What is expected?

That the build process run without error,
so my guess would be that the packages should be included in the dependcy.

What is actually happening?

Had to install the lib by hand:
npm i -D @babel/types

System Info

No response

Any additional comments?

Use the vue template:
npm create vue@latest
with this comes many ts cofig files, i hope i doesn't messed up here.

use the guide https://www.freecodecamp.org/news/how-to-create-and-publish-a-vue-component-library-update/
to setup the lib project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions