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

Client 2.4.3 errors out when executing a query with a hot cache #4034

Closed
GlennMatthys opened this issue Oct 23, 2018 · 13 comments · Fixed by Akryum/vue-cli-plugin-apollo#73
Closed
Assignees

Comments

@GlennMatthys
Copy link

When a query runs for a second time (for example navigating back to an already visited page) and there's data in the cache, QueryManager crashes.

The data is fetched through vue-apollo. It uses a watch query, the fetchPolicy is set to 'cache-and-network'.

Intended outcome:
Query runs and fills cache as usual

Actual outcome:
Execution errors out:

QueryManager.js?96af:414 Uncaught TypeError: Invalid property descriptor. Cannot both specify accessors and a value or writable attribute, #<Object>
    at Function.defineProperty (<anonymous>)
    at handleKey (cloneDeep.js?1e56:28)
    at Array.forEach (<anonymous>)
    at cloneDeepHelper (cloneDeep.js?1e56:30)
    at eval (cloneDeep.js?1e56:13)
    at Array.forEach (<anonymous>)
    at cloneDeepHelper (cloneDeep.js?1e56:12)
    at handleKey (cloneDeep.js?1e56:27)
    at Array.forEach (<anonymous>)
    at cloneDeepHelper (cloneDeep.js?1e56:30)

apollo-2 4 3-error

How to reproduce the issue:
Working on a jsfiddle

Versions
Fails with:

  System:
    OS: Windows 10
  Binaries:
    npm: 5.6.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: 42.17134.1.0
  npmPackages:
    apollo-client: ^2.4.3 => 2.4.3
    vue-apollo: ^3.0.0-beta.11 => 3.0.0-beta.25
    vue-cli-plugin-apollo: ^0.17.2 => 0.17.2

Works with:

  System:
    OS: Windows 10
  Binaries:
    npm: 5.6.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: 42.17134.1.0
  npmPackages:
    apollo-client: ^2.4.2 => 2.4.2
    vue-apollo: ^3.0.0-beta.11 => 3.0.0-beta.25
    vue-cli-plugin-apollo: ^0.17.2 => 0.17.2
@GlennMatthys
Copy link
Author

Perhaps related to #3881

@dongsuo

This comment has been minimized.

@benjamn
Copy link
Member

benjamn commented Oct 23, 2018

@GlennMatthys No, this is a new problem, which I accidentally introduced when I replaced that fclone package yesterday: 78e2ad8. Fix coming soon!

@benjamn benjamn self-assigned this Oct 23, 2018
@benjamn
Copy link
Member

benjamn commented Oct 23, 2018

In case there wasn't a GitHub notification, you should be able to fix this by running

npm install apollo-utilities@latest

to get version 1.0.23.

@frankdugan3
Copy link

@benjamn apollo-client@2.4.3 still pulls in apollo-utilities@1.0.22 as a nested dep, which I can override with yarn's resolutions, but even after I do that, queries work correctly but mutations still produce the same error.

@benjamn
Copy link
Member

benjamn commented Oct 23, 2018

See also #4039

@NicoAiko
Copy link

In case there wasn't a GitHub notification, you should be able to fix this by running

npm install apollo-utilities@latest

to get version 1.0.23.

This fixed my problem, thanks!

@Akryum
Copy link

Akryum commented Oct 25, 2018

Version 1.0.23 doesn't fix the issue in vue-cli, but forcing 1.0.21 works.

@ghaddon
Copy link

ghaddon commented Oct 25, 2018

I just started getting the same error. Is Apollo-utilities@latest for server or client?

@alx13
Copy link

alx13 commented Oct 26, 2018

I can confirm that 1.0.23 doesn't fix all deepClone issues.
Besides, apollo-client package is sticked to explicit version of apollo-utilities, so it doesn't get 1.0.23 until its republished:

"apollo-utilities": "1.0.22"

@GlennMatthys
Copy link
Author

@benjamn This issue should be reopened as it doesn't appear to be fixed yet.

@benjamn
Copy link
Member

benjamn commented Oct 26, 2018

This should now be fixed with apollo-utilities@1.0.24 (just published).

@ghaddon
Copy link

ghaddon commented Oct 26, 2018

Just tested with apollo-utilities@1.0.24 and is working for me. THX...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants