Skip to content
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

Pin core-js version in apollo-env #961

Merged
merged 1 commit into from
Feb 3, 2019

Conversation

bfirsh
Copy link
Contributor

@bfirsh bfirsh commented Feb 2, 2019

The API was changed in 3.0.0-beta.12 (released 2 hours ago) causing this error in my application:

Error: Cannot find module 'core-js/proposals/array-flat-and-flat-map'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
    at Function.Module._load (internal/modules/cjs/loader.js:529:25)
    at Module.require (internal/modules/cjs/loader.js:657:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/Users/ben/p/miles/node_modules/apollo-env/src/polyfills/array.ts:1:1)
    at Module._compile (internal/modules/cjs/loader.js:721:30)
    at Module._compile (/Users/ben/p/miles/example/node_modules/pirates/lib/index.js:83:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:732:10)
    at Object.newLoader [as .js] (/Users/ben/p/miles/example/node_modules/pirates/lib/index.js:88:7)
    at Module.load (internal/modules/cjs/loader.js:620:32)

It seems sensible to pin to a specific beta version while the API is moving around. When 3.0.0 is released, then it could be switched back to ^3.0.0.

The API was changed in 3.0.0-beta.12.
`core-js/proposals/array-flat-and-flat-map` was removed.
@apollo-cla
Copy link

@bfirsh: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/

Copy link

@stevefan1999-personal stevefan1999-personal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could fallback to one version before 12 -- 3.0.0-beta.11 in specific

@koenpunt
Copy link
Contributor

koenpunt commented Feb 2, 2019

We can assume that the moved dependencies will not move back, so I think it's a good idea to pin to the current latest beta, but also update the imports.

Using patch-package I applied this patch:

diff --git a/node_modules/apollo-env/lib/polyfills/array.js b/node_modules/apollo-env/lib/polyfills/array.js
index 9d5bb1f..7dc6721 100644
--- a/node_modules/apollo-env/lib/polyfills/array.js
+++ b/node_modules/apollo-env/lib/polyfills/array.js
@@ -1,4 +1,5 @@
 "use strict";
 Object.defineProperty(exports, "__esModule", { value: true });
-require("core-js/proposals/array-flat-and-flat-map");
+require("core-js/es/array/flat");
+require("core-js/es/array/flat-map");
 //# sourceMappingURL=array.js.map
diff --git a/node_modules/apollo-env/lib/polyfills/object.js b/node_modules/apollo-env/lib/polyfills/object.js
index f302992..c215afb 100644
--- a/node_modules/apollo-env/lib/polyfills/object.js
+++ b/node_modules/apollo-env/lib/polyfills/object.js
@@ -1,4 +1,4 @@
 "use strict";
 Object.defineProperty(exports, "__esModule", { value: true });
-require("core-js/proposals/object-from-entries");
+require("core-js/es/object/from-entries");
 //# sourceMappingURL=object.js.map

@JakeDawkins
Copy link
Contributor

Thanks so much for this @bfirsh I'll publish this now

@JakeDawkins JakeDawkins merged commit 4043c68 into apollographql:master Feb 3, 2019
@bfirsh bfirsh deleted the patch-1 branch February 3, 2019 01:45
@JakeDawkins
Copy link
Contributor

Released in apollo@2.4.3!

nellh added a commit to OpenNeuroOrg/openneuro that referenced this pull request Feb 5, 2019
@trevor-scheer trevor-scheer mentioned this pull request May 14, 2019
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants