question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Cannot find module 'core-js/modules/es7.object.entries'

See original GitHub issue

I am trying to serve an executable schema. I get the following error while using version 2.0.2. Works totally fine with version 2.0.0.

Error: Cannot find module 'core-js/modules/es7.object.entries'
    at Object.<anonymous> (/home/wawhal/oss/schema-stitching-examples/multiple-remote-graphql-apis/node_modules/apollo-upload-server/lib/middleware.js:14:1)

Here is the code:

import {
  makeRemoteExecutableSchema,
  introspectSchema,
  mergeSchemas
} from 'graphql-tools';
import { HttpLink } from 'apollo-link-http';
import { ApolloServer } from 'apollo-server';
import fetch from 'node-fetch';

// secret keys
const GITHUB_TOKEN = process.env.GITHUB_TOKEN || 'github-token';
const X_HASURA_ACCESS_KEY = process.env.X_HASURA_ACCESS_KEY || '<key>';

// graphql API metadata
const graphqlApis = [
  {
    uri: 'https://api.github.com/graphql',
    headers: { 'Authorization': `Bearer ${GITHUB_TOKEN}` }
  },
  {
    uri: 'https://api1.com/graphql',
    headers: { 'x-hasura-access-key': X_HASURA_ACCESS_KEY }
  }
];

// create executable schemas from remote GraphQL APIs
const createRemoteExecutableSchemas = async () => {
  let schemas = [];
  for (const api of graphqlApis) {
    const link = new HttpLink({
      uri: api.uri,
      headers: api.headers,
      fetch
    });
    const remoteSchema = await introspectSchema(link);
    const remoteExecutableSchema = makeRemoteExecutableSchema({
      schema: remoteSchema,
      link
    });
    schemas.push(remoteExecutableSchema);
  }
  return schemas;
};

const createNewSchema = async () => {
  const schemas = await createRemoteExecutableSchemas();
  console.log(schemas);
  return mergeSchemas({
    schemas
  });
};

const runServer = async () => {
  console.log('here');
  // Get newly merged schema
  const schema = await createNewSchema();
  // start server with the new schema
  const server = new ApolloServer({
    schema
  });
  server.listen().then(({url}) => {
    console.log(`Running at ${url}`);
  });
};

try {
  console.log('here');
  runServer();
} catch (err) {
  console.error(err);
}

/label bug

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:14
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

11reactions
fungiboletuscommented, Aug 17, 2018

A temporary workaround : npm install core-js

5reactions
zainulabidin302commented, Feb 2, 2019

After upgrading to 2.3.3, I got the same error again. Downgrading to 2.0.4 fixed it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm error:“ Cannot find module 'core-js/modules/es7.object ...
I ran into the same issue in my mac. Solved it by installing the package globally. npm install core-js -g ...
Read more >
Module not found: Error: Can't resolve 'core-js/es6'
I found possible answer. You have core-js version 3.0, and this version doesn't have separate folders for ES6 and ES7; that's why the ......
Read more >
Cannot find polyfill es7.object.entries - Vue Forum
This is the error am getting when i run “npm run dev”: Module build failed (from ./node_modules/babel-loader/lib/index.js):
Read more >
WebpackError: Cannot find module 'core-js/modules/es6.array ...
When it came to spinning up the development server I encountered this error: phalient@phalient-sp4:/mnt/c/projects/repos/techphlex-landing-site$ np > gatsby@3.0 ...
Read more >
es7-object-polyfill - npm
A polyfill for missing Object.values / Object.entries. Latest version: 1.0.1, last published: 3 years ago. Start using es7-object-polyfill ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found