Compiled with problems:X
ERROR in ./node_modules/dotenv/lib/main.js 24:11-24
Module not found: Error: Can't resolve 'fs' in '/Users/yubyeong-gug/Desktop/product_server_admin_client/product_server_admin_client/node_modules/dotenv/lib'
ERROR in ./node_modules/dotenv/lib/main.js 26:13-28
Module not found: Error: Can't resolve 'path' in '/Users/yubyeong-gug/Desktop/product_server_admin_client/product_server_admin_client/node_modules/dotenv/lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
ERROR in ./node_modules/dotenv/lib/main.js 28:11-24
Module not found: Error: Can't resolve 'os' in '/Users/yubyeong-gug/Desktop/product_server_admin_client/product_server_admin_client/node_modules/dotenv/lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "os": require.resolve("os-browserify/browser") }'
- install 'os-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "os": false }
백엔드를 주력으로 하는 나로서는 create-react-app로 생성된 react의 앱에 dotenv가 기본 내장되어 있는지도 몰랐다.
코드 최상단에
import dotenv from "dotenv"
dotenv.config()
이런거 지워 버리면 된다.
감사합니다. 🙏
엥? 기본으로 있었던건가요...저도 한참 찾다가 몰랐네요...