Composition-api: fix: ssrRef not usable within onGlobalSetup

Created on 17 Feb 2021  ·  3Comments  ·  Source: nuxt-community/composition-api

🐛 The bug
Since updating to 0.17.0 an ssrRef defined within onGlobalSetup throws the nuxt error: _Cannot read property 'context' of undefined_

In 0.16.4 it worked fine. It is broken in 0.17.0 and it is still present in 0.20.1.

🛠️ To reproduce
Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/blue-night-1lyfh?file=/plugins/awesome-plugin.js
  2. See error

🌈 Expected behaviour
ssfRef can be defined within onGlobalSetup.

ℹ️ Additional context
As recommended I added the onGlobalSetup within a plugin

The docs state that using ssrRef within onGlobalSetup should be possible:
https://composition-api.nuxtjs.org/helpers/ssrRef

bug

All 3 comments

Hopefully this is now fixed in 0.20.2 - thanks for reporting it ❤️

I seems like still not working in v0.24.4

スクリーンショット 2021-06-13 19 34 03

@daikiojm Could you create an issue with a reproduction?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tcastelly picture tcastelly  ·  7Comments

JoeyYoung1997 picture JoeyYoung1997  ·  7Comments

MartinMalinda picture MartinMalinda  ·  4Comments

samnap11 picture samnap11  ·  6Comments

posva picture posva  ·  3Comments