Coder Social home page Coder Social logo

vue-cli-ssr-example's People

Contributors

lentoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

vue-cli-ssr-example's Issues

Uncaught RangeError: Maximum call stack size exceeded

请教一下~ 热更新报了如下错误:
bootstrap:1007 Uncaught RangeError: Maximum call stack size exceeded
at hotAddUpdateChunk (bootstrap:1007)
at webpackHotUpdateCallback (bootstrap:36)
at webpackHotUpdateCallback (bootstrap:37)
at webpackHotUpdateCallback (bootstrap:37)
at webpackHotUpdateCallback (bootstrap:37)
at webpackHotUpdateCallback (bootstrap:37)
at webpackHotUpdateCallback (bootstrap:37)
at webpackHotUpdateCallback (bootstrap:37)
at webpackHotUpdateCallback (bootstrap:37)
at webpackHotUpdateCallback (bootstrap:37)

npm install 报错,如何解决

npm WARN tar ENOENT: no such file or directory, open 'E:\Users\Ekols\Desktop\vue-cli-ssr-example-master\node_modules.staging\vue-6d59989b\src\platforms\weex.DS_Store'
npm ERR! Unexpected end of JSON input while parsing near '...4.0.0","css-loader":"'
npm WARN tar ENOENT: no such file or directory, lstat 'E:\Users\Ekols\Desktop\vue-cli-ssr-example-master\node_modules.staging@vue'

npm build:win 一直都是生产环境

"build:server": "cross-env NODE_ENV=production WEBPACK_TARGET=node vue-cli-service build --mode server",
修改成以上后解决图片访问404问题

Use --no-clean flags to Avoid move file back and forward

我注意到你的package.json中,为了处理win和mac在移动文件的命令的不同而写了两条命令

    "build:win": "npm run build:server && move dist\\vue-ssr-server-bundle.json bundle && npm run build:client && move bundle dist\\vue-ssr-server-bundle.json && cross-env WEBPACK_TARGET=node NODE_ENV=production node ./server/ssr.js",
    "build:mac": "npm run build:server && mv dist/vue-ssr-server-bundle.json bundle && npm run build:client && mv bundle dist/vue-ssr-server-bundle.json",

但实际上这个移动文件的操作可能是是没有必要的,我个人认为你这里移动文件的目的是为了避免vue-cli-service构建之前清理文件而导致丢失前面构建的结果,然而这个行为是可以关闭的,只需要在构建client时传入 --no-clean 既可以关闭。

另外,我注意到build:win和build:mac有些许的区别,build:win完成构建后会自动启动服务器,而mac不会,不知道是否为作者无意之举呢?

文档:
outputDir

当运行 vue-cli-service build 时生成的生产环境构建文件的目录。注意目标目录在构建之前会被清除 (构建时传入 --no-clean 可关闭该行为)。

根据你博文一步一步来的时候发现了错误

现在进行到的步骤,生成build.json,通过createBundleRenderer方法打包到index.html,这里都是没有问题的,但是当我使用koa-static进行暴露dist目录的时候报错
Uncaught ReferenceError: require is not defined at Object.2c92 (es6.array.iterator":1) at a (bootstrap:63) at Module.a949 (external "vue":1) at a (bootstrap:63) at bootstrap:195 at bootstrap:195
当不使用koa-static的时候却没有问题,只是理想的dist中的资源不能访问

运行服务器后没有CSS样式

你好,我根据你的博客文章来改写我之前写的浏览器渲染vue的项目,但是用SSR渲染后CSS样式全部消失了,请问如何才能在SSR渲染时显示我之前写的CSS样式呢?

Error: Server-side bundle should have one single entry file.

|  Building for production...(node:6480) UnhandledPromiseRejectionWarning: Error: Server-side bundle should have one single entry file. Avoid using CommonsChunkPlugin in the server config.
    at G:\Users\The Project\nodejs-vue\vue-cli-ssr-example\node_modules\vue-server-renderer\server-plugin.js:68:13
    at _next1 (eval at create (G:\Users\The Project\nodejs-vue\vue-cli-ssr-example\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:8:1)
    at eval (eval at create (G:\Users\The Project\nodejs-vue\vue-cli-ssr-example\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:22:1)
    at callback (G:\Users\The Project\nodejs-vue\vue-cli-ssr-example\node_modules\copy-webpack-plugin\dist\index.js:77:17)
    at G:\Users\The Project\nodejs-vue\vue-cli-ssr-example\node_modules\copy-webpack-plugin\dist\index.js:118:24
(node:6480) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which
was not handled with .catch(). (rejection id: 1)
(node:6480) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit c
ode.
|  Building for production...

npm install

为什么运行 npm install 时 如何解决
npm WARN tar ENOENT: no such file or directory, open 'E:\Users\Ekols\Desktop\vue-cli-ssr-example-master\node_modules.staging\vue-6d59989b\src\platforms\weex.DS_Store'
npm ERR! Unexpected end of JSON input while parsing near '...4.0.0","css-loader":"'
npm WARN tar ENOENT: no such file or directory, lstat 'E:\Users\Ekols\Desktop\vue-cli-ssr-example-master\node_modules.staging@vue'

mac package

script:
"build:win": "npm run build:server && mv dist/vue-ssr-server-bundle.json bundle && npm run build:client && mv bundle dist/vue-ssr-server-bundle.json && cross-env WEBPACK_TARGET=node NODE_ENV=production node ./server/ssr.js",

无法运行

你们能运行吗,我的运行不了呢,前端访问反的Internal Server Error

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.