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

Error InMemoryCache has only a getter #3910

Closed
flyingangel opened this issue Sep 12, 2018 · 4 comments · Fixed by #3932
Closed

Error InMemoryCache has only a getter #3910

flyingangel opened this issue Sep 12, 2018 · 4 comments · Fixed by #3932

Comments

@flyingangel
Copy link

flyingangel commented Sep 12, 2018

Bug appears since tag apollo-boost@0.1.15

..\node_modules\apollo-boost\lib\index.js:35 Uncaught TypeError: Cannot set property InMemoryCache of #<Object> which has only a getter
    at Object.parcelRequire...\node_modules\apollo-boost\lib\index.js.apollo-client (..\node_modules\apollo-boost\lib\index.js:35)

>>> export { gql, InMemoryCache, HttpLink };  //browser point to this

Built with Parcel + Babel es2017

@andrewjmead
Copy link

andrewjmead commented Sep 12, 2018

I'm seeing the same error. Version 0.1.14 is working fine. Upgrading to 0.1.15 generates the error above. You can recreate this by just importing ApolloBoost as shown in the file below.

import ApolloBoost from "apollo-boost"
// Enough to trigger the error in 0.1.15

@alexkrolick
Copy link
Contributor

alexkrolick commented Sep 21, 2018

I think this is an issue where Babel 7 works but Babel 6 doesn't

export * from 'apollo-cache-inmemory';

export { gql, InMemoryCache, HttpLink };

It's not allowing an export from the * to be renamed

alexkrolick added a commit to alexkrolick/apollo-client that referenced this issue Sep 21, 2018
@alexkrolick
Copy link
Contributor

The PR should fix this - is anyone going to take a look?

@ss-limafriyadi
Copy link

Is the fix published to registry already? 🙏

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2023
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.

4 participants