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

Could not find a declaration file for module 'react' for PNPM setup #9580

Closed
3 of 7 tasks
sparanoid opened this issue Nov 24, 2023 · 1 comment
Closed
3 of 7 tasks
Labels
bug An error in the Docusaurus core causing instability or issues with its execution closed: duplicate This issue or pull request already exists in another issue or pull request

Comments

@sparanoid
Copy link
Contributor

sparanoid commented Nov 24, 2023

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

The initial project created by create-docusaurus with PNPM will not resolve TypeScript hinting for react package

Reproducible demo

No response

Steps to reproduce

Follow https://docusaurus.io/docs/typescript-support to create a new repo:

  1. pnpx create-docusaurus@latest my-website classic --typescript
  2. Open the project
  3. Create a component with import React from 'react';

Expected behavior

React resolves correctly (The result in this screenshot is created by npx):

image

Actual behavior

image

Your environment

  • Public source code: N/A
  • Public site URL: N/A
  • Docusaurus version used: 3.0.0
  • Environment name and version (e.g. Chrome 89, Node.js 16.4): Node.js 21.2.0
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): macOS 14.1.1

Self-service

  • I'd be willing to fix this bug myself.
@sparanoid sparanoid added 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 labels Nov 24, 2023
@Josh-Cena
Copy link
Collaborator

Duplicate of #9080

@Josh-Cena Josh-Cena marked this as a duplicate of #9080 Nov 24, 2023
@Josh-Cena Josh-Cena closed this as not planned Won't fix, can't repro, duplicate, stale Nov 24, 2023
@Josh-Cena Josh-Cena added closed: duplicate This issue or pull request already exists in another issue or pull request and removed status: needs triage This issue has not been triaged by maintainers labels Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution closed: duplicate This issue or pull request already exists in another issue or pull request
Projects
None yet
Development

No branches or pull requests

2 participants