Notice
Recent Posts
Recent Comments
Link
250x250
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- JavaScript
- Express
- mysql 5.5
- Effective Java 3/e
- regex
- java
- 퀵소트
- Spring Batch
- current_date
- npm
- nodejs
- REACT
- spring
- spring cloud
- Chunk
- Regular expression
- Effective Java
- update
- REACTJS
- git
- eslint
- Node
- 정규표현식
- upgrade
- log4j2
- migration
- MySQL
- expire_logs_days
- Webpack
- log_bin
Archives
- Today
- Total
내 세상
[NodeJS] 이유를 알 수 없는 오류 process is not defined 본문
728x90
반응형
ReactJS + Webpack5 + React-refresh 조합으로 변경 중 굉장히 심각한 사태 발발함.
path.js:25 Uncaught ReferenceError: process is not defined
at eval (path.js:25:1)
at ./node_modules/path/path.js (main-9dd8e511eae3f7488f14.js:5817:1)
at options.factory (main-9dd8e511eae3f7488f14.js:9481:31)
at __webpack_require__ (main-9dd8e511eae3f7488f14.js:8908:32)
at fn (main-9dd8e511eae3f7488f14.js:9139:21)
at eval (main.js:2:1)
at ./node_modules/dotenv/lib/main.js (main-9dd8e511eae3f7488f14.js:3446:1)
at options.factory (main-9dd8e511eae3f7488f14.js:9481:31)
at __webpack_require__ (main-9dd8e511eae3f7488f14.js:8908:32)
at fn (main-9dd8e511eae3f7488f14.js:9139:21)
해당 코드 분석해본 결과 내가 해결할 수 없음을 깨닫게 되어
땅을 치고 눈물을 흘리고 있을 때 해결책을 발견하였음.
module.exports = {
...,
plugins: [
isDevelopment && new ReactRefreshWebpackPlugin(),
new MiniCssExtractPlugin(),
new HtmlWebpackPlugin({ template: "public/index.html" }),
new webpack.ProvidePlugin({
process: "process/browser"
})
].filter(Boolean),
...
}
위의 코드는 webpack.config.js 파일의 일부임.
Config 파일에서 plugins 부분에 new webpack.ProvidePlugin을 통해 process를 지정하여 문제를 해결함
728x90
반응형
'Technical > NodeJS' 카테고리의 다른 글
[NestJS] mysql connection pool Cannot read properties of undefined 이슈 조치 (0) | 2024.07.04 |
---|---|
[NodeJS] Material-React-Table 사용법 (0) | 2024.03.06 |
[NodeJS] Package 비교, node-redis VS ioredis (0) | 2024.02.20 |
[NodeJS] CentOS 7 환경 NodeJS Offline 설치 (0) | 2024.02.16 |
Eslint & Prettier 참고사이트 (0) | 2024.01.18 |