Apollo Client reports "Number expected" and stops running in IE11
See original GitHub issueIntended outcome:
Use of Apollo React client in our app, running on IE11.
I’ve created a minimal repository that demonstrates the problem:
https://github.com/tamouse/apollo-coinbase-client-showing-ie11-error
There is no special code, particularly. The app pulls in polyfills for IE11 from https://polyfill.io, which is in the public/index.html
file in the repo.
Actual outcome:
The console reports the error “Number expected”:
The debugger reports the following line as the source of the error:
How to reproduce the issue:
See demo repo at https://github.com/tamouse/apollo-coinbase-client-showing-ie11-error
Versions
$ npx envinfo@latest --preset apollo --clipboard
npx: installed 1 in 0.888s
System:
OS: macOS 10.14.3
Binaries:
Node: 8.12.0 - /usr/local/bin/node
Yarn: 1.13.0 - /usr/local/bin/yarn
npm: 6.5.0 - /usr/local/bin/npm
Browsers:
Chrome: 72.0.3626.109
Firefox: 63.0.3
Safari: 12.0.3
npmPackages:
apollo-boost: ^0.1.28 => 0.1.28
react-apollo: ^2.4.1 => 2.4.1
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
Error handling - Apollo GraphQL Docs
This occurs when a request containing multiple named operations doesn't specify which operation to run (i.e., operationName ), or if the named operation...
Read more >Automatic persisted queries - Apollo GraphQL Docs
Clients send queries to Apollo Server as HTTP requests that include the GraphQL string of the query to execute. Depending on your graph's...
Read more >API Reference: ApolloServer - Apollo GraphQL Docs
A key-value cache that Apollo Server uses to store previously encountered GraphQL operations (as DocumentNode s). It does not store query results. Whenever ......
Read more >GraphQL schema basics - Apollo GraphQL Docs
This schema defines a hierarchy of types with fields that are populated from your back-end data stores. The schema also specifies exactly which...
Read more >Handling operation errors - Apollo GraphQL Docs
Apollo Client can encounter a variety of errors when executing operations on ... is not populated), and any returned data is cached and...
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
Yeah. Basically the Map.prototype.set polyfill is doing 1/key, and if the key is Object.create(null) it will throw “Number expected” in IE11.
It looks like this is fixed in the latest version of polyfill-library, but it’s yet to be pushed to polyfill.io (https://github.com/Financial-Times/polyfill-library/commit/09ff71b1b41f7f3e283640b27193054c030b0cbb)
My temporary solution was to only polyfill exactly what I needed:
https://polyfill.io/v3/polyfill.min.js?flags=gated&features=Object.entries,Object.assign
. Luckily IE11 supports basic Map anywaythank you, @samboylett , I think this closes the issue