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

Error: Cannot find module core-js/proposals/array-flat-and-flat-map #962

Closed
mtmckenna opened this issue Feb 2, 2019 · 13 comments
Closed

Comments

@mtmckenna
Copy link

Intended outcome:

Trying to install/run a serverless app using apollo-server-lambda.

Actual outcome:

When running apollo-server-lambda v2.3.3, I get an error when running the server in apollo-env. That error looks like this:

'Error: Cannot find module \'core-js/proposals/array-flat-and-flat-map\'',

I think the issue is that apollo-env pins the core-js dependency to ^3.0.0-beta.3, which currently resolves to 3.0.0-beta.12. From the looks of it, the issue is that, between beta.11 to beta.12, the array-flat-and-flat-map.js has moved?

How to reproduce the issue:

I think running any app with apollo-server-lambda v2.3.3 should do it.

Versions

apollo-env 0.3.0

@timothyis
Copy link

Thanks for submitting this issue @mtmckenna, I was about to do the same.

We have an example of deploying apollo-server with ZEIT Now and the pinning issue caused our example – which also allows users to initialize projects from – to break and make our CI fail.

I highly suggest pinning a specific version (no ^) when using beta versions to avoid unnecessary breakage.

I had to install and pin a specific core-js version to fix this: https://github.com/zeit/now-examples/commit/2583cd773b6e6e04f827c1d899689ef913e237ad

@timothyis
Copy link

Looks like a PR was submitted! #961

@gae123
Copy link

gae123 commented Feb 2, 2019

CI stopped working suddenly here with this error some time on Friday midday PST .. very serious!!! We are using apollo graphql which I guess depends on this, but I thought we had all our versions locked in package.json, need to understand better why we were impacted....

@JakeDawkins
Copy link
Contributor

Thanks for jumping on this so quickly! We've pinned the core-js dep and rereleased. Fixes should be in [email protected]

Qard pushed a commit to Qard/apm-agent-nodejs that referenced this issue Feb 5, 2019
The previously passing range of apollo-server-express versions
is now failing due to a breaking change in an in-range version
of core-js, which it depends on. This excludes that range.

See: apollographql/apollo-tooling#962
Qard added a commit to elastic/apm-agent-nodejs that referenced this issue Feb 5, 2019
The previously passing range of apollo-server-express versions is now failing due to a breaking change in an in-range version of core-js, which it depends on. This excludes that range.

See: apollographql/apollo-tooling#962
@zamiang
Copy link

zamiang commented Feb 5, 2019

I believe apollo server express (and likely other apollo-server-x) need to be updated as part of this fix - the dep chain looks like so and as such, I can't update to [email protected]

[email protected]
  └─┬ [email protected]
    └─┬ @apollographql/[email protected]
      └── [email protected]

@nodegin
Copy link

nodegin commented Feb 6, 2019

Can you rollback?
Can you test before publishing breaking changes?
This damn issue crashed my production website.

@nodegin
Copy link

nodegin commented Feb 6, 2019

Actually I forced to use "apollo-server-express": "2.2.2"

I cannot believe that old version is hitting this bug, WTF?

@trevor-scheer
Copy link
Member

@nodegin can you please clarify? Did pinning to version 2.2.2 fix the problem? Or was it broken because you already had it pinned to that version? Going to try to reproduce to confirm while I wait to hear from you.

@trevor-scheer
Copy link
Member

@nodegin I've confirmed at least this much, if you have any information otherwise please let me know

[email protected] gets [email protected] (12->13 had a breaking change)

[email protected] gets a pinned version of core-js via
@apollographql/[email protected] -> [email protected] -> [email protected]

@abernix
Copy link
Member

abernix commented Feb 6, 2019

For anyone who is still running into this bug, if an apollo-server-* package was installed prior to the above fix, the version of core-js with the breaking change is likely baked into the project's package-lock.json or yarn.lock as a transitive dependency, as that is what these files intend to do: Achieve reproducible installs regardless of any new transitive dependency which might fulfill semver desires but inadvertently break a build.

You can inspect the lock files manually to see if that is the case (e.g. search for [email protected]), but running npm install [email protected] (or yarn add [email protected]) again should cause the package manager to update the transitive dependency resolution in the lock-file.

@mschipperheyn
Copy link

I still have this issue

My installation installs core-js 2.6.5. This is one hell of a rabbit hole with "babel-core": "7.0.0-bridge.0",. I'm surprised I haven't run into this more often

@trevor-scheer
Copy link
Member

@mschipperheyn I don't quite follow, re: "babel-core": "7.0.0-bridge.0"

This much looks correct to me:

Could you paste the error or share some more info? A reproduction would be great if you're able to provide one.

@eternalmatt
Copy link

For me, I had core-js as a root dependency, and it seemed apollo-env was using that rather than the local one. I solved this with npm i core-js@3
bad:

good:

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

No branches or pull requests

10 participants