// 1. 페이지의 에서 최대한 위에 이 코드를 붙여넣으세요. // 아래의 메타 태그를 복사해 사이트 홈페이지의 섹션에 붙여 넣어주세요. //2. 여는 태그 바로 뒤에 코드를 붙여넣으세요.

새소식

반응형
REACT/ERROR LOG

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.

  • -
반응형

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: { "timers": require.resolve("timers-browserify") }'

- install 'timers-browserify'

If you don't want to include a polyfill, you can use an empty module like this: resolve.fallback: { "timers": false }

 

 

이 오류는 웹팩이 Node.js의 핵심 모듈 중 하나인 timers를 찾을 수 없어서 발생하는 것입니다.

 

timers-browserify 모듈 설치 및 웹팩 설정 수정

 

해당 오류 메시지에 따르면, timers-browserify 모듈을 설치하고 웹팩 설정 파일에서 다음과 같이 resolve.fallback 속성을 추가해야 합니다:

// webpack.config.js
module.exports = {
  // ...
  resolve: {
    fallback: {
      timers: require.resolve('timers-browserify')
    }
  }
};
반응형
Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.