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

Fix: Could not find a declaration file for module 'react-dom/client' when running the project #162

Open
sanG-github opened this issue May 19, 2023 · 0 comments

Comments

@sanG-github
Copy link

Issue

This error was raised the first time I start the project. But I tried this solution and it works as expected.

ERROR in src/index.tsx:4:28
TS7016: Could not find a declaration file for module 'react-dom/client'. '/Users/sang.huynh/Desktop/react-template/node_modules/react-dom/client.js' implicitly has an 'any' type.
  If the 'react-dom' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom'
    2 | import { BrowserRouter } from 'react-router-dom';
    3 |
  > 4 | import { createRoot } from 'react-dom/client';
      |                            ^^^^^^^^^^^^^^^^^^
    5 |
    6 | import App from './App';
    7 | import configureI18n from './i18n';

Expected

yarn run start works like a champ.

Steps to reproduce

  1. generate the project with either Bootstrap or Tailwind
  2. run yarn install to install all dependencies
  3. run yarn run start
  4. The error appear in the browser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant