TypeError: Object(...) is not a function in depTrackingCache.js when Upgrading from 1.2.10 to 1.3.0
See original GitHub issueIntended outcome: Upgrading from apollo-cache-inmemory ^1.2.10 to 1.3.0 Intend no issues in consuming code Actual outcome: Stack trace in browser
in /node_modules/apollo-cache-inmemory/lib/depTrackingCache.js:8
this.depend = wrap(function (dataId) { return _this.data[dataId]; }, {
defaultNormalizedCacheFactory
return new DepTrackingCache(seed);
/node_modules/apollo-cache-inmemory/lib/depTrackingCache.js:60
How to reproduce the issue:
Consumer code (unchanged) (originaly from React Starter Kit)
// https://www.apollographql.com/docs/react/basics/caching.html#configuration
return new InMemoryCache({
dataIdFromObject,
});
}
Versions
System: OS: Windows 10 Binaries: Yarn: 1.9.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 5.7.1 - C:\Program Files\nodejs\npm.CMD Browsers: Edge: 42.17134.1.0 npmPackages: apollo-cache-inmemory: 1.3.0 => 1.3.0 apollo-client: 2.4.2 => 2.4.2 apollo-link: ^1.0.7 => 1.2.1 apollo-link-error: ^1.0.3 => 1.0.7 apollo-link-http: ^1.3.2 => 1.5.3 apollo-link-logger: ^1.1.0 => 1.2.0 apollo-link-schema: ^1.0.1 => 1.0.6 react-apollo: 2.1 => 2.1.9
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:22 (3 by maintainers)
Top Results From Across the Web
TypeError: "x" is not a function - JavaScript - MDN Web Docs
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value...
Read more >Backbone.js
The function is passed the raw response object, and should return the attributes hash to be set on the model. The default implementation...
Read more >AngularJS TypeError: object is not a function
I've tried upgrading to Angular 1.2.15 and I get the same error. And unstable version 1.3.0-beta.4 same result. Cause: For some reason ...
Read more >CoffeeScript
The JavaScript arguments object is a useful way to work with functions that accept variable numbers of arguments. CoffeeScript provides splats ... ,...
Read more >Uncaught TypeError: object is not a function on "(function($)"
Javascript ignore missing semi-colon and try to interpret it. So if you don't input the semi-colon, it use the next line to see...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Stuck with this error as well, I have no idea how to fix it 😦. I am using TS with next and react-apollo.
On line 1 in the optimism.js in apollo-cache-inmemory node_modules folder I replaced this line
var wrap = require('optimism').wrap;
withimport { wrap } from 'optimism/lib'
.And now my app has started working again.
I guess this is a workaround for now, and I’m still trying to investigate why this is happening.