NerdWalletOSS / apollo-cache-policies

An extension of the Apollo 3 cache with support for advanced cache policies.
Apache License 2.0
157 stars 21 forks source link

`process.nextTick` throw `process is not defined` in browser (2.11.0) #73

Closed Amnesthesia closed 1 year ago

Amnesthesia commented 1 year ago

This looks like a node method that should probably be polyfilled:

https://github.com/NerdWalletOSS/apollo-cache-policies/blame/b2bdb08fb60bb7f60cac888bf4bc933ad40c0f11/src/cache/InvalidationPolicyCache.ts#L356

Looks like process.nextTick isn't being automatically polyfilled by webpack 5, should this maybe include a polyfill or be done differently? Upgrading to this version breaks the page

danReynolds commented 1 year ago

Ah makes sense, fixing.

danReynolds commented 1 year ago

Switched it to use setTimeout in 3.0.2. If you're using the enableCollections: true flag, note that useFragment/useFragmentWhere has been updated in 3.0.0 with a breaking change to nest the filter in an options object so look out for those references. Thanks for the report!

Amnesthesia commented 1 year ago

Thanks mate! Closing :)