2016-02-28 66 views
0

在手機上加載我的測試MEAN應用程序時,mongo上出現以下錯誤。Mongo在手機上加載時出錯

我不知道哪個模塊是那個,因爲我自己沒有加載它。

奇怪的是,在桌面瀏覽器上,錯誤不會彈出。

我使用貓鼬作爲mongodb驅動程序。可能這個錯誤與它有關。

任何見解?

Error: Cannot find module '../schemas/favicon.icSchema' 
    at Function.Module._resolveFilename (module.js:339:15) 
    at Function.Module._load (module.js:290:25) 
    at Module.require (module.js:367:17) 
    at require (internal/module.js:16:19) 
    at modelNamer (/home/rafapaulin/lab/rpg-am/routes/general.js:13:10) 
    at /home/rafapaulin/lab/rpg-am/routes/general.js:19:3 
    at Layer.handle [as handle_request] (/home/rafapaulin/lab/rpg-am/node_modules/express/lib/router/layer.js:95:5) 
    at next (/home/rafapaulin/lab/rpg-am/node_modules/express/lib/router/route.js:131:13) 
    at Route.dispatch (/home/rafapaulin/lab/rpg-am/node_modules/express/lib/router/route.js:112:3) 
    at Layer.handle [as handle_request] (/home/rafapaulin/lab/rpg-am/node_modules/express/lib/router/layer.js:95:5) 
    at /home/rafapaulin/lab/rpg-am/node_modules/express/lib/router/index.js:277:22 
    at param (/home/rafapaulin/lab/rpg-am/node_modules/express/lib/router/index.js:349:14) 
    at param (/home/rafapaulin/lab/rpg-am/node_modules/express/lib/router/index.js:365:14) 
    at Function.process_params (/home/rafapaulin/lab/rpg-am/node_modules/express/lib/router/index.js:410:3) 
    at next (/home/rafapaulin/lab/rpg-am/node_modules/express/lib/router/index.js:271:10) 
    at Function.handle (/home/rafapaulin/lab/rpg-am/node_modules/express/lib/router/index.js:176:3) 
+0

你可以分享一下代碼:'/home/rafapaulin/lab/rpg-am/routes/general.js:13:10'。它可能有幫助。 – unflores

+0

肯定@unflores '變種modelNamer =函數(集合){ 返回要求( '../架構/' + collection.slice(0,-1)+ '模式') };' 基本上,這函數根據傳遞的路由構建模型的名稱。 它在桌面上工作,實際上,它也適用於移動設備上的POST請求......錯誤只是在頁面加載到移動設備上時彈出,但路由仍然有效 –

回答

0

好的,所以我認爲這裏可能會有一些魔術與你的路徑發生。您可以嘗試從桌面和移動設備上調用此命令時記錄當前路徑。

或者你可以嘗試類似下面的內容:absolute requires這將確保你需要一些絕對路徑從你的server.js目錄。

相關問題