Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial start to update vue-apollo latest beta .21 #158

Merged
merged 7 commits into from
Oct 6, 2018

Conversation

dohomi
Copy link
Contributor

@dohomi dohomi commented Sep 5, 2018

This PR will update to latest changes of vue-apollo

@dohomi
Copy link
Contributor Author

dohomi commented Sep 5, 2018

@Akryum it would be great if you could check if thats how vue-apollo should be used. Thanks!

@negezor
Copy link
Contributor

negezor commented Sep 5, 2018

There is a problem with fakeInstance, described here
vuejs/apollo#378

@dohomi
Copy link
Contributor Author

dohomi commented Sep 6, 2018

@negezor do you have any idea how to solve it for your setup? I can't follow your issue in my current

@dohomi
Copy link
Contributor Author

dohomi commented Sep 7, 2018

@negezor Ok in a separate project I receive the same error:

  TypeError: Cannot read property '$ssrContext' of undefined
  - server-bundle.js:487 Component.options.data
    server-bundle.js:487:14
  - index.js:148 createFakeInstance
    [lumen-cms]/[vue-apollo]/ssr/index.js:14

@Akryum is this an internal error of vue-apollo or is the upgraded code not complete yet? Would be great if we find a fix for this.

@negezor
Copy link
Contributor

negezor commented Sep 7, 2018

@dohomi Of course, I do not know for sure, but maybe should not try to emulate the very Vue instance?

@dohomi
Copy link
Contributor Author

dohomi commented Sep 10, 2018

@negezor I updated to the latest .25 and now everything works fine. Could you update your code and re-validate?

@negezor
Copy link
Contributor

negezor commented Sep 10, 2018

@dohomi yes, it works. Thanks 😄

Could you look at my question?

@dohomi
Copy link
Contributor Author

dohomi commented Sep 10, 2018

I have to revert - currently I see this error:

 ERROR 

  TypeError: Cannot read property 'props' of undefined
  
  - vue.runtime.common.js:1354 normalizeProps
    [lumen-cms]/[vue]/dist/vue.runtime.common.js:1354:23
  
  - vue.runtime.common.js:1456 Object.mergeOptions
    [lumen-cms]/[vue]/dist/vue.runtime.common.js:1456:3
  
  - utils.js:14 exports.getMergedDefinition
    [lumen-cms]/[vue-apollo]/lib/utils.js:14:27
  
  - utils.js:188 Promise.then.component
    [lumen-cms]/[vue-apollo]/ssr/utils.js:188:19
  
  
  - next_tick.js:188 process._tickCallback
    internal/process/next_tick.js:188:7

This error is not persistent though, I couldn't figure out why and when it exactly happens. Usually after few reloads its gone

@dohomi
Copy link
Contributor Author

dohomi commented Sep 10, 2018

@Akryum the error is being shown after the change of 5ad3117
this happens in beta.25
Beside that, it seems to only break in production mode when deploying to a server - dev mode seems to work fine

@AndrewBogdanovTSS
Copy link
Contributor

any updates regarding this issue?

@dohomi
Copy link
Contributor Author

dohomi commented Sep 26, 2018

@Akryum @atinux do you guys have any idea how to solve this for this module? Currently the upgrades are not possible due to the SSR problem

@jakub300
Copy link

Hey, I was able to debug this and filled vuejs/apollo#402.

Also keep in mind that that new SSR is throwing errors for many apps (see vuejs/apollo#392).

Last thing, in the last line modified in this PR it should be nuxtState.apollo = ApolloSSR.getStates(apolloProvider) instead of nuxtState.apollo = ApolloSSR.exportStates(apolloProvider). With that change this PR will work with simple projects (that doesn't touch any of the above issues).

@aldarund
Copy link
Contributor

A side note

nuxtState.apollo = ApolloSSR.exportStates(apolloProvider)
Nuxt state should be serializable. So there should be only values, not a functions or Symbols. So it need to make sure that there no not serializeable data like Symbols

@dohomi dohomi merged commit 9b86218 into master Oct 6, 2018
@kieusonlam kieusonlam deleted the vue-apollo-upgrade-beta-21 branch May 19, 2019 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants