일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- concept
- graphQL
- Redux
- Props
- JavaScript
- Interface
- solidity
- SSR
- HTML
- API
- middleware
- 삶
- web
- blockchain
- error
- Ethereum
- built in object
- hardhat
- evm
- express.js
- useState
- typeScript
- CLASS
- REACT
- node.js
- 기준
- tailwindcss
- nextJS
- CSS
- bitcoin
- Today
- Total
ReasonJun
'React' refers to a UMD global, but the current file is a module. Consider adding an import instead. 본문
'React' refers to a UMD global, but the current file is a module. Consider adding an import instead.
ReasonJun 2023. 6. 17. 14:00Error
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.
'Frontend > Error' 카테고리의 다른 글
Next.js : Stop scrolling after moving the page via 'router.push/replace ...' (0) | 2023.07.28 |
---|---|
Can I use 'useState' in an async function in 'Nextjs'? (0) | 2023.07.10 |
Next.js : Module not found: Can't resolve 'fs' (0) | 2023.06.19 |
npm ERR! Cannot read properties of null (reading 'edgesOut') (styled-components install error) (0) | 2023.06.13 |
Uncaught ReferenceError: _ is not defined (0) | 2023.06.06 |