Types aren't recognized if the project is setup with pnpm #9080
Labels
bug
An error in the Docusaurus core causing instability or issues with its execution
status: needs triage
This issue has not been triaged by maintainers
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
If a project is initialized with pnpm, types aren't being recognized. This is not an issue with npm. Manually importing missing types fixes the errors. So I wanted to report this as it may be a bug. Tested it on latest 2.4.1 and canary Alpha3.0.0.
Reproducible demo
No response
Steps to reproduce
You may reproduce this issue by starting a new project with the command
pnpm create docusaurus
. Yes, I did select the typescript option during setup.Expected behavior
It should recognize types similar to when installed with npm.
Actual behavior
Getting missing type errors.
![image](https://private-user-images.githubusercontent.com/53895969/246667635-80bc3f0e-fee3-4fdf-9b20-e5692af62c83.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTgyNjA3NzcsIm5iZiI6MTcxODI2MDQ3NywicGF0aCI6Ii81Mzg5NTk2OS8yNDY2Njc2MzUtODBiYzNmMGUtZmVlMy00ZmRmLTliMjAtZTU2OTJhZjYyYzgzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjEzVDA2MzQzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ2ZmZhZTk2MTVkMWUwNjUzZDNmYWYyODI3NDMwYTY4MzZlYzA3OGE0MzZiOTQ4MThmMTNjZWY1ZWI2ODEzYjUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.oV6VxtcKXBm1zbwl-GbK2WfExVSwoebAWco_TLKYdRk)
![image](https://private-user-images.githubusercontent.com/53895969/246667646-40720b8c-02fc-4531-bbee-2e34b1ddcfb5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTgyNjA3NzcsIm5iZiI6MTcxODI2MDQ3NywicGF0aCI6Ii81Mzg5NTk2OS8yNDY2Njc2NDYtNDA3MjBiOGMtMDJmYy00NTMxLWJiZWUtMmUzNGIxZGRjZmI1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjEzVDA2MzQzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRjMGQ1M2Q0ZjE3Y2MxYjc3NGYyOTkyZmJhNzQ4YjkxMTlmMDAxOTMzMTllZDJiZjhjNDExNmU0NzAwMmYwMjcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.brmTjPpYuQRFAMEqXC8_HfuZVpvCWi3I9mhz2U1P9Yk)
Also getting errors for and not limited to node types, react types etc.
Solution
![image](https://private-user-images.githubusercontent.com/53895969/246667907-1fb5b81c-4baa-4943-8d55-f6748b2cabe0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTgyNjA3NzcsIm5iZiI6MTcxODI2MDQ3NywicGF0aCI6Ii81Mzg5NTk2OS8yNDY2Njc5MDctMWZiNWI4MWMtNGJhYS00OTQzLThkNTUtZjY3NDhiMmNhYmUwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjEzVDA2MzQzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRmYWEzMzBkYzc2ZGFiYTM0ZjQ2NzU0YTUxMjllZTkwZDUyMjkyMWU1NzI2NGYyYzMzZGM5Mzg5YmQ0M2I2MzgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.291ODXqjpPANtxTHGpBnprpDXT9MT5MquV-Gsox5X54)
Manually installing types like so
Your environment
Self-service
The text was updated successfully, but these errors were encountered: