Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop VS Code importing react methods from Minified React?

At some point, my VS Code has started to import react hooks from react/cjs/react.production.min, not from react.
This annoys me because it only causes errors when I'm developing on my localhost:3000 even with simple hooks such as useState, useEffect, etc.. Is there a way to configure VS Code to import React materials from 'react'? I am tired of manually fixing import statements.
The first pic is the error page I get on Next JS, and the second pic is showing how VS Code automatically imports useState from Minified React. The line above it is the ones I manually fixed. nextjs error

imports

like image 487
Intaek Avatar asked Oct 19 '25 05:10

Intaek


1 Answers

maybe you can try to install the Auto Import

https://marketplace.visualstudio.com/items?itemName=steoates.autoimport

or simple reinstall your vscode maybe the fastest way to resolve it

like image 96
River Avatar answered Oct 21 '25 20:10

River



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!