[ 상황 ]
react 애플리케이션을 start 하거나 build 하면 아래와 같이
Failed to parse source map from ... Error: ENOENT: no such file or directory
extractParamsFromWeigthMap.ts 파일이 존재하지 않아 source map 파싱이 실패한다.

[ 원인 ]
실제로 사용하고 있는 face-api.js 모듈은 extractParamsFromWeigthMap.ts 파일을 제공하지 않음을 확인할 수 있다.

[ 해결-1 ]
`source-map-loader` rule의 exclude에 해당 경로를 설정한다.
module: { ... rules: [ { exclude: [ /\/node_modules\/face-api.*/, ... ], loader: require.resolve('source-map-loader') ... }, ... }
[ 해결-2 ]
`source-map-loader` rule의 loader에 filterSourceMapping 옵션을 설정한다.
module: { ... rules: [ { use: [ { loader: 'source-map-loader', options: { filterSourceMappingUrl: (url, resourcePath) => { if (/.*\/node_modules\/face-api.*/.test(resourcePath)) { return false; } return true; }, }, }, ], ... }, ... }
'Develop > React' 카테고리의 다른 글
[error] Module not found: Error: Can't resolve 'fs' in '..../node_modules/~~~~~~~' (0) | 2022.01.01 |
---|---|
[react] 리액트 코딩 컨벤션 (0) | 2021.12.30 |
[react] React 최적화 성능개선 데이터 관리 - 10년 된 태블릿에서도 빠르게 돌려보자. (0) | 2021.11.26 |
[react] 사용자 입력이 끝나면 리렌더링 하게 하고 싶다. (0) | 2021.10.04 |
댓글