Skip to content

Types compiled using alias that doesn't exist in package #316

@jeremydrichardson

Description

@jeremydrichardson

Describe the bug

The build is changing my types in an unexpected way.

Source code

import type { Props as ReactSelectProps } from 'react-select';

in v3.8.0 is being transformed to

import { ReactSelectProps } from 'react-select';

but ReactSelectProps doesn't exist in react-select as it was an alias that was being used.

v3.7.3 works and looks like:

import type { Props as Props_2 } from 'react-select';

Reproduction

https://stackblitz.com/edit/vitejs-vite-aeyi1j?file=dist%2Findex.tsx.es.d.ts

Steps to reproduce

Running npm run build with the Vite config in the stackblitz gives the result in the /dist folder.

System Info

System:
    OS: macOS 14.4.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 150.53 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.12.0 - ~/.nvm/versions/node/v20.12.0/bin/node
    npm: 8.19.4 - ~/Sites/mm-ui-components/node_modules/.bin/npm
    pnpm: 7.28.0 - /opt/homebrew/bin/pnpm
  Browsers:
    Chrome: 123.0.6312.86
    Edge: 123.0.2420.53
    Safari: 17.4.1
  npmPackages:
    vite: ^5.0.10 => 5.2.6 
    vite-plugin-dts: 3.7.3 => 3.7.3

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions