Closed GSBL closed 6 years ago
这个项目你是自己搭建还是之前的版本? 有几个插件要装一下新版本
dependencies:{ "egg-view-vue-ssr": "^3.0.5", }
devDependencies:{ "easywebpack-cli": "^3.6.0", "easywebpack-vue": "^3.6.0", "egg-webpack": "^3.2.8", "egg-webpack-vue": "^2.0.0", "webpack-manifest-resource-plugin": "^2.0.2" }
具体依赖可以对比一下骨架项目
npm update 之后也是报错
2018-02-02 10:58:25,399 DEBUG 11776 Resource#this.config.injectRes []
2018-02-02 10:58:25,401 ERROR 11776 [-/172.18.18.48/-/44ms GET /] nodejs.TypeError: Cannot read property 'app/app.js' of undefined
at Resource.inject (/Users/huangguanghui/Desktop/repos/egg/smart-analytics/node_modules/server-side-render-resource/lib/resource.js:124:36)
at renderString.then.html (/Users/huangguanghui/Desktop/repos/egg/smart-analytics/node_modules/egg-view-vue-ssr/lib/engine.js:99:28)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
{
"name": "smart-analytics",
"version": "3.6.5",
"description": "smart-analytics",
"scripts": {
"build": "cross-env easywebpack build prod",
"build:dev": "cross-env easywebpack build dev",
"build:test": "cross-env easywebpack build test",
"build:prod": "cross-env easywebpack build prod",
"dll": "cross-env easywebpack build dev -f webpack.dll.js",
"start": "node index.js",
"start:test": "cross-env EGG_SERVER_ENV=test node index.js",
"start:prod": "cross-env EGG_SERVER_ENV=prod NODE_ENV=production npm start",
"kill": "pkill --signal SIGINT egg-vue-webpack-boilerplate",
"kill-mac": "kill -9 $(lsof -i:7001 |grep 'node'|awk '{print $2}')",
"kill-win": "taskkill -PID $(netstat -ano | findstr 7001|awk '{print $5}') -F",
"restart": "npm run kill-port && npm run start",
"lint": "eslint .",
"fix": "eslint --fix ."
},
"dependencies": {
"axios": "^0.17.1",
"connect-ensure-login": "^0.1.1",
"egg": "^2.1.0",
"egg-cors": "^2.0.0",
"egg-logger": "^1.5.0",
"egg-passport": "^2.0.1",
"egg-session": "^3.1.0",
"egg-validate": "^1.0.0",
"egg-view-vue-ssr": "^3.0.5",
"element-ui": "^2.1.0",
"extend": "~3.0.0",
"js-cookie": "^2.2.0",
"koa-ensure-login": "^0.1.0",
"lodash": "^4.17.4",
"mint-ui": "^2.2.9",
"mockjs": "^1.0.1-beta3",
"moment": "^2.17.1",
"passport-local": "^1.0.0",
"server-side-render-resource": "^1.0.3",
"vue": "^2.5.0",
"vue-hot-reload-api": "^2.1.0",
"vue-router": "^3.0.1",
"vue-server-renderer": "^2.5.3",
"vuex": "^3.0.1",
"vuex-router-sync": "^5.0.0"
},
"devDependencies": {
"animate.css": "^3.5.2",
"autod-egg": "^1.0.0",
"autoprefixer": "^7.1.4",
"babel-core": "^6.26.0",
"babel-eslint": "^8.1.2",
"babel-loader": "^7.1.2",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-transform-object-assign": "^6.22.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-runtime": "^6.15.0",
"babel-preset-env": "^1.6.0",
"bootstrap": "^3.3.7",
"cross-env": "^5.0.0",
"directory-named-webpack-plugin": "^2.2.3",
"easywebpack-cli": "^3.6.0",
"easywebpack-vue": "^3.6.0",
"egg-logview": "^1.0.0",
"egg-mysql": "^3.0.0",
"egg-passport-local": "^1.1.0",
"egg-view-nunjucks": "^2.1.4",
"egg-webpack": "^3.2.8",
"egg-webpack-vue": "^2.0.0",
"eslint": "^4.3.0",
"eslint-config-egg": "^5.0.0",
"eslint-loader": "^1.9.0",
"eslint-plugin-vue": "^2.0.1",
"imagemin-webpack-plugin": "^1.5.2",
"install": "^0.10.2",
"ip": "^1.1.5",
"jquery": "^3.3.1",
"less": "^2.7.3",
"less-loader": "^4.0.5",
"node-sass": "^4.5.3",
"postcss-loader": "^2.1.0",
"progress-bar-webpack-plugin": "^1.10.0",
"sass-loader": "^6.0.6",
"sha1": "^1.1.1",
"uglifyjs-webpack-plugin": "^1.1.8",
"vconsole": "^3.0.0",
"vue-echarts": "^3.0.1",
"vue-template-compiler": "^2.4.4",
"webpack-manifest-plugin": "^1.3.2",
"webpack-manifest-resource-plugin": "^2.0.2"
},
"engines": {
"node": ">=6.0.0"
},
"ci": {
"version": "6, 7, 8"
},
"repository": {
"type": "git",
"url": "git+https://github.com/hubcarl/egg-vue-webpack-boilerplate.git"
},
"author": "hubcarl@126.com",
"license": "MIT",
"homepage": "https://github.com/hubcarl/egg-vue-webpack-boilerplate"
}
@GSBL 最好删除 node_modules, 重新装一下依赖看看, 如果还出错,参考一下骨架项目依赖,或者 提供一个 github demo 我试试
server-side-render-resource 插入js, manifest.deps = undefined
manifest.json中也没deps属性: