Apollo-tooling: Module not found: Can't resolve 'core-js/features/array/flat'

Created on 21 Aug 2019  路  2Comments  路  Source: apollographql/apollo-tooling

Intended outcome:

Trying to install/run a serverless app using apollo-server-micro with nextjs.

Actual outcome:

When deploying to now using nextjsand apollo-server-micro v2.8.2, I get this error in apollo-env.

Failed to compile.
./node_modules/apollo-env/lib/polyfills/array.js
Module not found: Can't resolve 'core-js/features/array/flat' in '/tmp/4c43eb70/node_modules/apollo-env/lib/polyfills'

I tried just about every work-around I could find. Here are some other possibly related issues:

https://github.com/apollographql/apollo-server/issues/2263
https://github.com/apollographql/apollo-tooling/issues/962

How to reproduce the issue:

Here's a snippet of my package.json

"dependencies": {
    "@apollo/react-hooks": "^3.0.0",
    "@apollo/react-ssr": "^3.0.0",
    "apollo-cache-inmemory": "^1.6.2",
    "apollo-client": "^2.6.3",
    "apollo-link": "^1.2.12",
    "apollo-link-error": "^1.1.11",
    "apollo-link-http": "^1.5.15",
    "apollo-link-logger": "^1.2.3",
    "apollo-link-persisted-queries": "^0.2.2",
    "apollo-link-timeout": "^1.3.1",
    "apollo-server-micro": "^2.8.2",
    "core-js": "3.2.1",
    "graphql": "^14.4.2",
    "graphql-middleware": "^4.0.0",
    "graphql-shield": "^6.0.4",
    "graphql-tools": "^4.0.5",
    "nanoid": "^2.0.3",
    "next": "^9.0.4",
    "react": "^16.9.0",
    "react-dom": "^16.9.0",
    "react-swipeable-views": "^0.13.3",
  },
  "devDependencies": {
    "@babel/node": "^7.5.5",
    "@babel/plugin-transform-react-constant-elements": "^7.5.0",
    "@babel/plugin-transform-react-inline-elements": "^7.2.0",
    "babel-eslint": "^10.0.2",
    "babel-plugin-transform-imports": "^2.0.0",
    "css-loader": "^3.2.0",
    "eslint": "5",
    "eslint-config-airbnb": "^18.0.1",
    "eslint-config-prettier": "^6.0.0",
    "eslint-import-resolver-webpack": "^0.11.1",
    "eslint-plugin-import": "^2.18.2",
    "eslint-plugin-jsx-a11y": "^6.2.3",
    "eslint-plugin-prettier": "^3.1.0",
    "eslint-plugin-react": "^7.14.3",
    "eslint-plugin-react-hooks": "^1.6.1",
  },

if I should be posting this elsewhere, please let me know.

Most helpful comment

False alarm, it was webpack config issue for me.

All 2 comments

False alarm, it was webpack config issue for me.

What webpack issue? @stevez86

Was this page helpful?
0 / 5 - 0 ratings