Interesting internals causing SSR not to initialise a utils class #2005
-
I have an issue where on server-side loads, the store does not expect quite as I'd expect and a class method seems to be able to be called without a constructor calling first. I've decided on a code structure to initialise complex stores for my Nuxt module. I initialise my stores: And each creates the store definition e.g.: Then in my getters I have some common functionality I want to split out for ease of testing: You'll see that this should initialise here: However, on server-side, this function is called from a getter the It is only that function, so I imagine that I am not calling the other on server-side. Does anyone have an idea why this would be the case? I'm on the latest version of Nuxt. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
OK so I see the issue. So instead of
Using
will work |
Beta Was this translation helpful? Give feedback.
OK so I see the issue.
If I define a getter in a computed variable to return a function, I guess somewhere, perhaps vue internals, this causes the error.
So instead of
Using
will work