2017-02-26 278 views
18

這是我得到的錯誤:找不到模塊「。」在webpackMissingModule

Cannot find module "." at webpackMissingModule

這是我webpack.config.js文件。我怎樣才能找出哪條線路導致錯誤?如果它不是導致它的webpack.config.js,我可否知道我應該檢查什麼?

module.exports = [ 
    { 
    entry: { 
     core: './node_modules/core-js/client/shim.min.js', 
     zone: './node_modules/zone.js/dist/zone.js', 
     reflect: './node_modules/reflect-metadata/Reflect.js', 
     system: './node_modules/systemjs/dist/system.src.js' 
    }, 
    output: { 
     filename: './wwwroot/js/[name].js' 
    }, 
    target: 'web', 
    node: { 
     fs: "empty" 
    } 
    }, 
    { 
    entry: { 
     app: './wwwroot/app/main.ts', 
     developerlist: './wwwroot/app/developerlist.bootstrap.ts', 
     rating: './wwwroot/app/rating.bootstrap.ts' 
    }, 
    output: { 
     filename: './wwwroot/js/[name].js' 
    }, 
    devtool: 'source-map', 
    resolve: { 
     extensions: ['.webpack.js', '.web.js', '.ts', '.js'] 
    }, 
    module: { 
     loaders: [ 
     { test: /\.ts$/, loader: 'ts-loader' } 
     ] 
    } 
    }]; 

console.trace:

(anonymous) @ VM214:1 
webpackMissingModule @ system.js:6179 
SystemJSLoader$1 @ system.js:6179 
(anonymous) @ system.js:6299 
(anonymous) @ system.js:6308 
(anonymous) @ system.js:6311 
__webpack_require__ @ system.js:20 
(anonymous) @ system.js:66 
(anonymous) @ system.js:69 
VM215:1 console.trace 

Error: Cannot find module "." at webpackMissingModule (http://localhost:5000/js/system.js:6179:67) [] at new SystemJSLoader$1 (http://localhost:5000/js/system.js:6179:145) [] at http://localhost:5000/js/system.js:6299:14 [] at Object. (http://localhost:5000/js/system.js:6308:2) [] at Object. (http://localhost:5000/js/system.js:6311:30) [] at webpack_require (http://localhost:5000/js/system.js:20:30) [] at http://localhost:5000/js/system.js:66:18 [] at http://localhost:5000/js/system.js:69:10 [] code: "MODULE_NOT_FOUND"

+0

你可以prive完整的錯誤堆棧跟蹤? –

+0

添加了痕跡,但我不確定它是否有幫助。 –

+0

你忘了在package.json中添加模塊嗎? npm安裝也許?這有幫助嗎? https://stackoverflow.com/questions/34823655/webpack-missing-module-module-not-found – djalmaaraujo

回答

3

您是否嘗試過擺脫System.js的? webpack可以完成System.js可以完成的所有工作,但使用模塊捆綁器捆綁模塊捆綁器沒有意義。

+0

除了在運行時需要基於URL的遠程依賴關係之外。據我所知,它不能這樣做。在這種情況下,您可能會嘗試在webpack軟件包中使用systemjs – light24bulbs

1

我的問題是有關反應熱裝載機,好像有與之反應路由器v4的,我更新到最新版本(此時的測試版)的問題,它解決了這一錯誤

"react-hot-loader": "^3.0.0-beta.7" 

通過做

npm install --save-dev [email protected]