작성
·
772
0
제로초님 안녕하세요~
이 에러가 왜 나는 건지 알 수 있을까요? ㅠㅠ
검색해보니 webpack.config.js 설정을 해야한다고 하는데 강의에서 webpack.config.js 설정을 안했던 것 같아서요ㅜㅜ
도움 부탁드립니다!
[ event ] build page: /next/dist/pages/_error
[ wait ] compiling ...
[ error ] ./node_modules/destroy/index.js
Module not found: Can't resolve 'fs' in 'D:\work\study\react-nodebird\front\node_modules\destroy'
{
Component: [Function: Error] { displayName: 'ErrorPage' },
router: ServerRouter {
route: '/_error',
pathname: '/_error',
query: [Object: null prototype] {},
asPath: '/favicon.ico'
},
ctx: {
err: ModuleNotFoundError: Module not found: Error: Can't resolve 'fs' in 'D:\work\study\react-nodebird\front\node_modules\destroy'
at D:\work\study\react-nodebird\front\node_modules\next\node_modules\webpack\lib\Compilation.js:823:10
at D:\work\study\react-nodebird\front\node_modules\next\node_modules\webpack\lib\NormalModuleFactory.js:397:22
at D:\work\study\react-nodebird\front\node_modules\next\node_modules\webpack\lib\NormalModuleFactory.js:130:21
at D:\work\study\react-nodebird\front\node_modules\next\node_modules\webpack\lib\NormalModuleFactory.js:224:22
at D:\work\study\react-nodebird\front\node_modules\neo-async\async.js:2830:7
at D:\work\study\react-nodebird\front\node_modules\neo-async\async.js:6877:13
at D:\work\study\react-nodebird\front\node_modules\next\node_modules\webpack\lib\NormalModuleFactory.js:214:25
at D:\work\study\react-nodebird\front\node_modules\enhanced-resolve\lib\Resolver.js:213:14
at D:\work\study\react-nodebird\front\node_modules\enhanced-resolve\lib\Resolver.js:285:5
at eval (eval at create (D:\work\study\react-nodebird\front\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:13:1)
at D:\work\study\react-nodebird\front\node_modules\enhanced-resolve\lib\UnsafeCachePlugin.js:44:7
at D:\work\study\react-nodebird\front\node_modules\enhanced-resolve\lib\Resolver.js:285:5
at eval (eval at create (D:\work\study\react-nodebird\front\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:13:1)
at D:\work\study\react-nodebird\front\node_modules\enhanced-resolve\lib\Resolver.js:285:5
at eval (eval at create (D:\work\study\react-nodebird\front\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:25:1)
at D:\work\study\react-nodebird\front\node_modules\enhanced-resolve\lib\DescriptionFilePlugin.js:67:43 {
details: "resolve 'fs' in 'D:\\work\\study\\react-nodebird\\front\\node_modules\\destroy'\n" +
' Parsed request is a module\n' +
' using description file: D:\\work\\study\\react-nodebird\\front\\node_modules\\destroy\\package.json (relative path: .)\n' +
" Field 'browser' doesn't contain a valid alias configuration\n" +
' resolve as module\n' +
" D:\\work\\study\\react-nodebird\\front\\node_modules\\destroy\\node_modules doesn't exist or is not a directory\n" +
" D:\\work\\study\\react-nodebird\\front\\node_modules\\node_modules doesn't exist or is not a directory\n" +
" D:\\work\\study\\react-nodebird\\node_modules doesn't exist or is not a directory\n" +
" D:\\work\\study\\node_modules doesn't exist or is not a directory\n" +
" D:\\work\\node_modules doesn't exist or is not a directory\n" +
" D:\\node_modules doesn't exist or is not a directory\n" +
' looking for modules in D:\\work\\study\\react-nodebird\\front\\node_modules\n' +
' using description file: D:\\work\\study\\react-nodebird\\front\\package.json (relative path: ./node_modules)\n' +
" Field 'browser' doesn't contain a valid alias configuration\n" +
' using description file: D:\\work\\study\\react-nodebird\\front\\package.json (relative path: ./node_modules/fs)\n' +
' no extension\n' +
" Field 'browser' doesn't contain a valid alias configuration\n" +
" D:\\work\\study\\react-nodebird\\front\\node_modules\\fs doesn't exist\n" +
' .mjs\n' +
" Field 'browser' doesn't contain a valid alias configuration\n" +
" D:\\work\\study\\react-nodebird\\front\\node_modules\\fs.mjs doesn't exist\n" +
' .js\n' +
" Field 'browser' doesn't contain a valid alias configuration\n" +
" D:\\work\\study\\react-nodebird\\front\\node_modules\\fs.js doesn't exist\n" +
' .jsx\n' +
" Field 'browser' doesn't contain a valid alias configuration\n" +
" D:\\work\\study\\react-nodebird\\front\\node_modules\\fs.jsx doesn't exist\n" +
' .json\n' +
" Field 'browser' doesn't contain a valid alias configuration\n" +
" D:\\work\\study\\react-nodebird\\front\\node_modules\\fs.json doesn't exist\n" +
' .wasm\n' +
" Field 'browser' doesn't contain a valid alias configuration\n" +
" D:\\work\\study\\react-nodebird\\front\\node_modules\\fs.wasm doesn't exist\n" +
' as directory\n' +
" D:\\work\\study\\react-nodebird\\front\\node_modules\\fs doesn't exist",
missing: [Array],
origin: [NormalModule],
dependencies: [Array],
module: [NormalModule],
name: 'ModuleNotFoundError',
error: [Error]
},
req: IncomingMessage {
_readableState: [ReadableState],
readable: true,
_events: [Object: null prototype],
_eventsCount: 1,
_maxListeners: undefined,
socket: [Socket],
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: '1.1',
complete: true,
headers: [Object],
rawHeaders: [Array],
trailers: {},
rawTrailers: [],
aborted: false,
upgrade: false,
url: '/favicon.ico',
method: 'GET',
statusCode: null,
statusMessage: null,
client: [Socket],
_consuming: false,
_dumped: false,
next: [Function: next],
baseUrl: '',
originalUrl: '/favicon.ico',
_parsedUrl: [Url],
params: [Object],
query: {},
res: [ServerResponse],
_startAt: [Array],
_startTime: 2020-03-29T05:58:57.514Z,
_remoteAddress: '::1',
body: {},
secret: 'cookiesecret',
cookies: [Object: null prototype] {},
signedCookies: [Object: null prototype] {},
_parsedOriginalUrl: [Url],
sessionStore: [MemoryStore],
sessionID: 'GXPl-ODhYWU_cMYjOCI1yXozByq-S-_U',
session: [Session],
route: [Route],
[Symbol(kCapture)]: false
},
res: ServerResponse {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
_last: false,
chunkedEncoding: false,
shouldKeepAlive: true,
useChunkedEncodingByDefault: true,
sendDate: true,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: null,
_hasBody: true,
_trailer: '',
finished: false,
_headerSent: false,
socket: [Socket],
_header: null,
_onPendingData: [Function: bound updateOutgoingData],
_sent100: false,
_expect_continue: false,
req: [IncomingMessage],
locals: [Object: null prototype] {},
_startAt: undefined,
_startTime: undefined,
writeHead: [Function: writeHead],
__onFinished: [Function],
end: [Function: end],
statusCode: 500,
[Symbol(kCapture)]: false,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype]
},
pathname: '/_error',
query: [Object: null prototype] {},
asPath: '/favicon.ico',
store: {
dispatch: [Function (anonymous)],
subscribe: [Function: subscribe],
getState: [Function: getState],
replaceReducer: [Function: replaceReducer],
[Symbol(observable)]: [Function: observable]
},
isServer: true
}
}
GET /favicon.ico 500 321.342 ms - 6475
[ event ] disposing inactive page(s): /, /next/dist/pages/_error
GET /_next/static/webpack/cf9ddfa83beeb19b28b8.hot-update.json 200 6.255 ms - 35