ReasonJun

'React' refers to a UMD global, but the current file is a module. Consider adding an import instead. 본문

Frontend/Error

'React' refers to a UMD global, but the current file is a module. Consider adding an import instead.

ReasonJun 2023. 6. 17. 14:00
728x90

Error

When installing next.js as follows, an error like the following picture occurred.

 

Cause & Solution: 

https://www.totaltypescript.com/react-refers-to-a-umd-global

 

Explained: 'React' refers to a UMD global

Find out why this error occurs and learn how to fix it.

www.totaltypescript.com

 

 

 

 

Personal thought & solution

 

However, personally, I just followed the method provided by next.js, but I didn't understand why an error occurred. And when I looked further, it was an error that occurred when running the file in vs-code. That is, an error occurred according to the settings of vs-code. So, without further modification, I installed nextjs again in the same way as above and checked the extension.

Can't see it now, but there was a sign to reload this extension. I ran it and no errors occurred.

 

Even with the basic settings as above, the error discussed in this article does not occur.

728x90
Comments