Problem to start a Apollo Server with GraphQL in version 16
I am working with node and I have found an issue with this version:
"graphql": "^16.7.1", "@apollo/server": "^4.7.5"
When I run the command "npm run dev" the server shows the next message.
USERFOLDER/node_modules/@graphql-tools/utils/esm/helpers.js:1 import { parse } from 'graphql'; ^^^^^ SyntaxError: Named export 'parse' not found. The requested module 'graphql' is a CommonJS module, which may not support all module.exports as named exports. CommonJS modules can always be imported via the default export, for example using:
import pkg from 'graphql'; const { parse } = pkg;
at ModuleJob._instantiate (internal/modules/esm/module_job.js:104:21) at async ModuleJob.run (internal/modules/esm/module_job.js:149:5) at async Loader.import (internal/modules/esm/loader.js:166:24) at async Object.loadESM (internal/process/esm_loader.js:68:5)
I solved it with the version ^15.8.0 of graphql, the message does not appear with that version, but I would like to know if that messages appears for some issue with the last version or is there a thing that I should change with my configuration to run the server with the last version of graphql.
Thank you
@IvanGoncharov @hwillson can maybe help on this one?
@Alexis798 would you mind re-opening this issue over in https://github.com/apollographql/apollo-server? Thanks!
Ok, if there I find something I will post it here too.
Closing this for now, as it seems to be an issue related to a specific downstream package.