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

inferred type error happens in commonjs&pnpm project #31

Open
ryoppippi opened this issue Aug 15, 2024 · 0 comments
Open

inferred type error happens in commonjs&pnpm project #31

ryoppippi opened this issue Aug 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ryoppippi
Copy link

Bug description

When I create subcommand in commonjs project, it causes type error like this

The inferred type of 'install' cannot be named without a reference to '../../node_modules/.pnpm/[email protected]/node_modules/type-flag/dist'. This is likely not portable. A type annotation is necessary.(2742)

I found that

  • ES Module project is OK.
  • using Bun/npm does not causes this problem

Reproduction

https://stackblitz.com/edit/vitejs-vite-xrg77g?file=src%2Finstall.ts

You can see that install variable has an error.

Node.js package manager

pnpm

Environment

This bug happens not only in my env, but here is the env info.


  System:
    OS: macOS 14.5
    CPU: (11) arm64 Apple M3 Pro
    Memory: 564.69 MB / 36.00 GB
    Shell: 3.7.1 - /opt/homebrew/bin/fish
  Binaries:
    Node: 20.14.0 - ~/.local/share/devbox/global/default/.devbox/nix/profile/default/bin/node
    npm: 10.7.0 - ~/.local/share/devbox/global/default/.devbox/nix/profile/default/bin/npm
    pnpm: 9.7.0 - ~/.local/share/devbox/global/default/.devbox/nix/profile/default/bin/pnpm
    bun: 1.1.21 - ~/.local/share/aquaproj-aqua/bin/bun


### Can you contribute a fix?

- [ ] I’m interested in opening a pull request for this issue.
@ryoppippi ryoppippi added the bug Something isn't working label Aug 15, 2024
@ryoppippi ryoppippi changed the title inferred type error happens in commonjs project inferred type error happens in commonjs&pnpm project Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant