Questions tagged [vue-ssr]

45 questions
7
votes
1 answer

How to handle Nuxt SSR errors and show custom 404 || 500 pages?

How do you handle errors when Nuxt's SSR runs into an error? Currently i am using error() handler but it doesn't work in the production? This is the example of my Nuxt app. asyncData async asyncData({ store, route, error }) { return…
7
votes
1 answer

SSR build says "document is not defined" for a Vuejs cli3 SPA app using a Vue cli3 library

I have a fairly complex SPA Vue.js app created with Vue CLI v3. I want to transform this app to benefit from SSR (although I might end up using only preprendering...) My app is using custom Vuejs libraries created with the CLI v3 as well. These libs…
onekiloparsec
  • 2,013
  • 21
  • 32
4
votes
1 answer

GTM nonce-aware script does not work on all browsers for Custom HTML tags

I have a Vue application that uses SSR. In order to implement Content-Security-Policy, I use nonce-aware version of GTM snippet. But it was not adding the nonce to all scripts that get injected by gtm to the page (specifically Custom HTML tags). I…
4
votes
1 answer

Nuxt.js with vuex-persist - persisted state not available in asyncData upon page refresh

Upon first page refresh, the asyncData function is not able to fetch the persisted state. When I follow another NuxtLink, and go back to this page, while the state is not mutated in the meantime, the data is there. This means the persisted state is…
ViBoNaCci
  • 390
  • 3
  • 15
4
votes
4 answers

Dynamic publicPath When Rendering Pages with Vue SSR

We're happy users of Vue and its server-side rendering module, Vue SSR. One of the requirements of my project is that we be able to dynamically adjust Webpack's publicPath at runtime, so that we can obtain assets from our different CDNs (we have…
Ryan Miller
  • 1,053
  • 9
  • 22
3
votes
1 answer

run vue3 ssr on cloudflare workers

I'm trying to run a vue ssr app on cloudflare workers. I generated a new project using wrangler generate test I installed vue using npm install vue@next and npm install @vue/server-renderer I edited the index.js file like this: const { createSSRApp…
user1885099
  • 130
  • 2
  • 6
  • 28
3
votes
1 answer

How to remove window._nuxt_ in nuxt project, it is too large for me

When I use nuxt to develop my project, I find some problems. window.__NUXT__=(function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,_,$,aa, ..... code was too larger can I remove it or…
Leo_chen
  • 33
  • 5
3
votes
0 answers

vuejs + vuetify + ssr + typescript: Error: bundle export should be a function when using { runInNewContext: false }

I've created a project with vue-cli (vue create) with typescript and less support. After that I added vuetify (vue add vuetify). And everything worked as expected. But after adding ssr (vue add @akryum/ssr) I get this error: Error: bundle export…
Kian
  • 695
  • 2
  • 11
  • 23
3
votes
0 answers

Vue Cli 3 Build not minifying css

I have been looking into Vue and have got it working with what I need. Typescript SSR My sample project can be found at https://github.com/Alik2015/VueDemo. To run npm install npm run ssr:serve //development npm run ssr:build //production…
AliK
  • 962
  • 2
  • 10
  • 31
2
votes
0 answers

Vue.js server side rendering stop using inline CSS

Preface: Style loader reference: https://github.com/webpack-contrib/style-loader#linktag As per the documentation, style-loader allows the webpack to render tags in order to render the styling information. Main problem: Vue-style-loader is a forked…
2
votes
0 answers

How to set a google user's cookie via nuxt ssr?

I am trying to set a cookie if you login with google login through firebase. It is a little hard to explain but when i log in the cookie from my site is set and from google is set when i go to an other route it is stil set i even printed the user…
2
votes
0 answers

Server side rendering a single component in a multi page laravel application

I'm building a laravel application, the notifications in my navbar is a vueJS component.
J. Duo
  • 127
  • 3
  • 10
2
votes
0 answers

Why I get Unexpected token export Error on nodejs with vue cli and ssr?

I just created a vue project using the vue/cli v3.10.0 I add ssr to the project like vue-cli-ssr-example example. But after I build and run the server side (nodejs) and I try to browse to http://localhost:8080: But The following error occurs : error…
Shlomi Levi
  • 3,114
  • 1
  • 23
  • 35
2
votes
1 answer

Vue-i18n - Issue with dynamic localizations from http request

I m trying to load the localization from HTTP call as i want the languages to be dynamic and manageable, rather than shipping it with the application. I did a work around using the SSR sample and some of my own implementation. But on the initial…
Fahid Mohammad
  • 910
  • 3
  • 17
  • 47
2
votes
0 answers

vue.js Data Pre-Fetching Problems

I'm building an app following guide https://ssr.vuejs.org/en/data.html. So i have structure: server.js const express = require('express'); const server = express(); const fs = require('fs'); const path = require('path'); const…
Viktor
  • 21
  • 4
1
2 3