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

[Bug]: Incorrect type when using typescript module resolution bundler #5835

Open
yf-yang opened this issue Jun 16, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@yf-yang
Copy link

yf-yang commented Jun 16, 2024

Version

System:
    OS: macOS 13.2.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
    Memory: 28.32 MB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Browsers:
    Chrome: 125.0.6422.176
    Safari: 16.3
  npmPackages:
    @modern-js/app-tools: ^2.53.0 => 2.53.0 
    @modern-js/module-tools: ^2.53.0 => 2.53.0 
    @modern-js/plugin-tailwindcss: 2.53.0 => 2.53.0

Details

Open apps/app/modern.config.ts
The line

import { tailwindcssPlugin } from '@modern-js/plugin-tailwindcss';

complains:

Could not find a declaration file for module '@modern-js/plugin-tailwindcss'. '/Workspace/modernjs-monorepo-example/node_modules/.pnpm/@modern-js+plugin-tailwindcss@2.53.0_@modern-js+runtime@2.53.0_react-dom@18.3.1_react@18.3.1__rzfb3ky5d4i7sz7np7gsckuq2e/node_modules/@modern-js/plugin-tailwindcss/dist/cjs/index.js' implicitly has an 'any' type.
There are types at '/Workspace/modernjs-monorepo-example/node_modules/@modern-js/plugin-tailwindcss/dist/types/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@modern-js/plugin-tailwindcss' library may need to update its package.json or typings.

Configurations:
"moduleResolution": "Bundler" is enabled in tsconfig of app.

Related:
microsoft/TypeScript#52363
Andrew's feedback: microsoft/TypeScript#52363 (comment)
https://arethetypeswrong.github.io/?p=@modern-js/plugin-tailwindcss@2.53.0

Reproduce link

https://github.com/yf-yang/modernjs-monorepo-example/tree/ts-bundler-bug

Reproduce Steps

Nope

@yf-yang yf-yang added the bug Something isn't working label Jun 16, 2024
@yf-yang
Copy link
Author

yf-yang commented Jun 16, 2024

BTW, would you mind taking a look of web-infra-dev/rspack#6818? Thanks for your guidance 😄

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