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

Type errors with exported types or variables in .ts files #459

Open
5 tasks done
pascalgermain opened this issue Dec 12, 2023 · 0 comments
Open
5 tasks done

Type errors with exported types or variables in .ts files #459

pascalgermain opened this issue Dec 12, 2023 · 0 comments

Comments

@pascalgermain
Copy link

Describe the bug

Hi,

In a project I want to build a library with its types, therefore I use the vue-tsc --project command to build types separately.

In this types building step, I get errors if I import types from vue in a .ts file and use them in exported types or variables.

Example in a .ts file:

export type NumberRef = Ref<number>

Triggers the error: error TS4081: Exported type alias 'NumberRef' has or is using private name 'Ref'.

Other example:

export const count: Ref<number> = ref(1)

Triggers the error: error TS4025: Exported variable 'count' has or is using private name 'Ref'.

I provided a minimal reproduction based on vitesse, with this commit reflecting what I'm describing here, happening with pnpm build:types or pnpm build commands.

Reproduction

pascalgermain/vitesse@fc47dec

System Info

System:
    OS: macOS 14.1.2
    CPU: (10) arm64 Apple M2 Pro
    Memory: 453.52 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.4.0 - ~/.nvm/versions/node/v21.4.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v21.4.0/bin/yarn
    npm: 10.2.5 - ~/.nvm/versions/node/v21.4.0/bin/npm
    pnpm: 8.12.0 - ~/.nvm/versions/node/v21.4.0/bin/pnpm
    bun: 1.0.17 - /opt/homebrew/bin/bun
  Browsers:
    Brave Browser: 120.1.61.100
    Chrome: 120.0.6099.71
    Safari: 17.1.2

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
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

1 participant