-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Cannot set property default of #<Object> which has only a getter #4843
Comments
I am having this issue as well using 0.4.0. Reverting back to 0.3.1 resolved my issue for the time being. |
I'm having a similar issue with Next.js & Apollo Client configuration ~ next-apollo, reverting back to old versions solved my issues for now. |
Also having this issue with Using the isolated packages / imports works for me:
|
Also having this issue when updating:
|
Had the issue with |
I have a similar issue after updating to 0.4.0 |
I had the exact same issue with |
Same for me. Downgrading fixed it. |
Temporary workaround |
If downgrade it, we'd lose the basic configuration that apollo-boost bring with 0.4.0. The exporting of DefaultClient is wrong in bundle file, The @vomchik workaround could work for now. |
This appears to be an upstream bug in the Rollup CommonJS output for In order to compile export * from "apollo-client"
export default class DefaultClient { ... } Rollup generates the following code: var ApolloClient__default = require('apollo-client');
Object.keys(ApolloClient__default).forEach(function (key) {
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return ApolloClient__default[key];
}
});
});
exports.default = DefaultClient; However, because
According to the ECMAScript specification, the I will open other issues in the appropriate places, but I wanted to give everyone an update here first. |
For reference, here's how Babel compiles the code above: "use strict";
exports.__esModule = true;
var _exportNames = {};
exports.default = void 0;
var _apolloClient = require("apollo-client");
Object.keys(_apolloClient).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
exports[key] = _apolloClient[key];
});
var DefaultClient = function DefaultClient() {};
exports.default = DefaultClient; Here's a link to a REPL you can play with. |
* Compile ESM bundle to CJS using Babel instead of Rollup. #4843 (comment) Fixes #4843. * Bump apollo-cache-inmemory bundle size limit from 5KB to 5.05KB. * Mention PR #4911 in CHANGELOG.md.
This should be fixed in |
I just installed |
This issue happened to me because I had |
Just to expand on what @mattschoch suggested above, it might be a good idea to use |
Just to expand on this, coming from ruby community, using |
Intended outcome:
I just tried to import the apolo boost in a node js environment that uses typescript.
Actual outcome:
How to reproduce the issue:
install
apollo-boost
and trying importVersions
The text was updated successfully, but these errors were encountered: