-
Couldn't load subscription status.
- Fork 243
Fix window is not defined in SSR #60
Conversation
Codecov Report
@@ Coverage Diff @@
## master #60 +/- ##
=======================================
Coverage 26.42% 26.42%
=======================================
Files 18 18
Lines 193 193
=======================================
Hits 51 51
Misses 142 142
Continue to review full report at Codecov.
|
|
Why did not anyone respond to this pr? |
|
?????? |
|
I also encountered this problem |
|
My bad. |
|
Sorry guys, I was in a motorcycle accident and have been recovering from severe nerve damage. I don't have time nor strength to maintain any code right now, just the act of typing is incredibly painful. |
|
@declandewet I am sorry to hear it. I hope you'll be better soon. ❤️ |
|
@declandewet That's awful! I hope you get a full and speedy recovery. |
|
@declandewet Is this project really retired? I don't see how those templates replace the need for this project. |
|
The template does not replace vue-meta @jazoom My brother @alexchopin and I are maintaining this project because it's a major dependency of nutxt.js |
|
Ah, thanks @atinux. I've been a bit confused about how to integrate it because looking at the example here: https://github.com/vuejs/vue-ssr-html-stream/blob/master/README.md But A similar thing is mentioned in the vue-meta README and it doesn't seem to make sense. I must be missing something. I might have a dig through Nuxt.js to see how you guys set it up with SSR. |
|
This may help you @jazoom https://github.com/nuxt/nuxt.js/blob/master/lib/render.js#L86-L117 SSR with Vue.js might be pretty hard at first, and nuxt.js adds a lot a features so the source code might be hard to understand. You can take a look at ream to work with SSR without conventions. |
|
Thanks @atinux . I've actually got SSR working beautifully in a complex app with WebPack chunking and everything. I've recently updated it to use the new bundle format. It's really just vue-meta I can't work out with SSR. By the way, Nuxt is awesome. I looked into using it but this app has too much of a complex routing system and layout to make it work with Nuxt. |
|
Ream looks interesting. Thanks for pointing that out. I hadn't heard of it before (probably because it's only 6 days old!). It looks like I might be able to see how they used vue-meta (along with how Nuxt does it). I wonder why egoist has started creating yet another build project (previously created vbuild and some other things). |
|
@jazoom i'm not planning on retiring vue-meta at all - i just unfortunately cannot type anything intensive like code, because my hands are in casts - so i have allowed the very generous Chopin brothers to maintain this in my stead while i recover from the nerve damage. the when you do Vue.use(VueMeta)That adds a const meta = app.$meta()
export default (context) => {
router.push(context.url)
context.meta = meta
return app
} |
|
@declandewet thanks for pointing that out. I've gotten that far. I think the piece I'm missing is how to access that context in server.js. I modelled my app after the Vue Hacker News 2.0 example app, which uses { url: req.url } as the context. That is also what is used as the context here: https://github.com/vuejs/vue-ssr-html-stream/blob/master/README.md I've realised I need to access that context that I've applied in the app (as you demonstrated) and now I'm just trying to work out how my server gets that context since all it has is the URL/ |
|
I think I've found what's going on. The |
|
For the benefit of those reading in future, this is what you need to do in server.js when using the new bundle from Vue 2.2: |
Related to ElemeFE/element#3050