-
카테고리
-
세부 분야
프론트엔드
-
해결 여부
미해결
path에러가 납니다.ㅠㅠ
21.06.16 00:16 작성 조회수 688
0
[webpack-cli] Failed to load '/Users/ohyunseok/Documents/PROJECT/Slacku/react-frontend/webpack.config.ts' config
[webpack-cli] webpack.config.ts:1:8 - error TS1259: Module '"path"' can only be default-imported using the 'esModuleInterop' flag
1 import path from 'path';
~~~~
node_modules/@types/node/path.d.ts:162:5
162 export = path;
~~~~~~~~~~~~~~
This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
webpack.config.ts:1:8 - error TS1259: Module '"path"' can only be default-imported using the 'esModuleInterop' flag
1 import path from 'path';
~~~~
node_modules/@types/node/path.d.ts:162:5
162 export = path;
~~~~~~~~~~~~~~
This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
webpack.config.ts:3:8 - error TS1259: Module '"/Users/ohyunseok/Documents/PROJECT/Slacku/react-frontend/node_modules/webpack/types"' can only be default-imported using the 'esModuleInterop' flag
3 import webpack, { Configuration as WebpackConfiguration } from 'webpack';
~~~~~~~
node_modules/webpack/types.d.ts:12245:1
12245 export = exports;
~~~~~~~~~~~~~~~~~
This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
error Command failed with exit code 2.
답변을 작성해보세요.
0
0
ryosuke kureha
질문자2021.06.16
App.tsx:12 Uncaught ReferenceError: $RefreshReg$ is not defined
at Object../layouts/App.tsx (App.tsx:12)
at __webpack_require__ (bootstrap:19)
at app.js:29889
at app.js:29894
at app.js:29895
./layouts/App.tsx @ App.tsx:12
__webpack_require__ @ bootstrap:19
(anonymous) @ app.js:29889
(anonymous) @ app.js:29894
(anonymous) @ app.js:29895
index.html:73
0
ryosuke kureha
질문자2021.06.16
{
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "Node",
"target": "es5",
"esModuleInterop": true
}
}
tsconfig-for-webpack-config.json 문제였습니다.
0
0
답변 5