Composition-api: fix: does not work with `pinia`

Created on 11 Jun 2020  路  4Comments  路  Source: nuxt-community/composition-api

Error message: cannot read property 'req' of undefined

https://github.com/posva/pinia/issues/179

I'm not entirely sure why this happens. setSSRContext should just assign extra properties to the context, not replace it right?

bug

Most helpful comment

I see, thanks! It would be great if these two great libraries would be friendly with each other:))

All 4 comments

Thanks for your reports 馃槃

The issue is that pinia wants to replace the setup function which conflicts with what nuxt-composition-api does.

EDIT: this was actually not the issue. Rather, some code that was incompatible with Nuxt wasn't being run until nuxt-composition-api added a global setup function at which point the incompatible code was run.

I see, thanks! It would be great if these two great libraries would be friendly with each other:))

I just found out about this issue in my project. It would be nice if this module provided some way for other modules/user code to hook into the global setup function.

I've submitted a PR to pinia that resolves this issue.

See https://github.com/posva/pinia/pull/180

Was this page helpful?
0 / 5 - 0 ratings

Related issues

P4sca1 picture P4sca1  路  4Comments

Quineone picture Quineone  路  5Comments

samnap11 picture samnap11  路  6Comments

tcastelly picture tcastelly  路  7Comments

masayuki-tsuji picture masayuki-tsuji  路  4Comments