Error: Cannot find module 'core-js/modules/es7.object.entries'
See original GitHub issueI 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:
- Created 5 years ago
- Reactions:14
- Comments:14 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
A temporary workaround :
npm install core-js
After upgrading to 2.3.3, I got the same error again. Downgrading to 2.0.4 fixed it.