You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError: Cannot read property 'filename' of undefined
at /Users/nico/node/react-koa2-server/node_modules/koa-react-view/index.js:152:36
at Array.forEach (native)
at cleanCache (/Users/nico/node/react-koa2-server/node_modules/koa-react-view/index.js:151:30)
at Object.app.context.render (/Users/nico/node/react-koa2-server/node_modules/koa-react-view/index.js:85:9)
at home.js:32:21
at /Users/nico/node/react-koa2-server/node_modules/react-router/lib/match.js:65:5
at /Users/nico/node/react-koa2-server/node_modules/react-router/lib/createTransitionManager.js:118:11
at done (/Users/nico/node/react-koa2-server/node_modules/react-router/lib/AsyncUtils.js:79:19)
at /Users/nico/node/react-koa2-server/node_modules/react-router/lib/AsyncUtils.js:85:7
at getComponentsForRoute (/Users/nico/node/react-koa2-server/node_modules/react-router/lib/getComponents.js:15:5)
at /Users/nico/node/react-koa2-server/node_modules/react-router/lib/getComponents.js:41:5
at /Users/nico/node/react-koa2-server/node_modules/react-router/lib/AsyncUtils.js:84:5
at Array.forEach (native)
at mapAsync (/Users/nico/node/react-koa2-server/node_modules/react-router/lib/AsyncUtils.js:83:9)
at getComponents (/Users/nico/node/react-koa2-server/node_modules/react-router/lib/getComponents.js:40:28)
at finishEnterHooks (/Users/nico/node/react-koa2-server/node_modules/react-router/lib/createTransitionManager.js:112:35)
And I found the error in the code
function cleanCache(match) {
Object.keys(require.cache).forEach(function(module) {
if (match(require.cache[module].filename)) {
delete require.cache[module];
}
});
}
It should be
function cleanCache(match) {
Object.keys(require.cache).forEach(function(module) {
if (require.cache[module] && require.cache[module].filename && match(require.cache[module].filename)) {
delete require.cache[module];
}
});
}
The text was updated successfully, but these errors were encountered:
And I found the error in the code
It should be
The text was updated successfully, but these errors were encountered: