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

Module not found in typescript react app #307

Open
gonzalofj opened this issue Jul 8, 2024 · 1 comment
Open

Module not found in typescript react app #307

gonzalofj opened this issue Jul 8, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@gonzalofj
Copy link

Environment

npx create-react-app --version
5.0.1

npm list consola
[email protected] /Users/gferreyra/dev/consola-test.ts
└── [email protected]

node --version
v21.6.2

Reproduction

npx create-react-app ts-console-module --template typescript
npm i consola
import {} from 'consola/browser'
npm run start

Describe the bug

Trying to use consola/browser module in a typescript react app, the module consola/browser is not found.

This only happens in the Typescript version of the app, in a standar javascript react app the module is correctly found.

image
image

Additional context

No response

Logs

No response

@gonzalofj gonzalofj added the bug Something isn't working label Jul 8, 2024
@selemondev
Copy link

Hey there @gonzalofj , if you change the moduleResolution from node to Bundler in your tsconfig.json file, it works perfectly.

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

2 participants