I'm trying out Apollo Client 3 with create-react-app. I'm getting the error below. Not sure what am I doing wrong.


Actual outcome:

Versions
System:
OS: macOS 10.15.6
Binaries:
Node: 14.5.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.5 - /usr/local/bin/npm
Browsers:
Chrome: 81.0.4044.138
Safari: 13.1.2
npmPackages:
@apollo/client: ^3.0.2 => 3.0.2
Can someone tell me what is the reason for this error?
This error occurs to me when I ordering parameters incorrectly in ApolloClient()
Can someone tell me what is the reason for this error?
The inmemorycache should be instantiated with "new" keyword.
Confirming @theneshofficial's answer (use new InMemoryCache()).
In strict mode, if you call a constructor function without new, this will be undefined. If you're using native class syntax rather than transpiling, constructor functions will throw an exception if you call them without using new, which helps prevent this problem, but most people are still transpiling class to function to support older browsers.
Most helpful comment
The inmemorycache should be instantiated with "new" keyword.