graphql-inspector icon indicating copy to clipboard operation
graphql-inspector copied to clipboard

require() of ES modules is not supported.

Open binary64 opened this issue 3 years ago • 4 comments

Describe the bug

I'm getting this on my pipeline

+ npm i -g @graphql-inspector/cli graphql
...
+ graphql-inspector validate "{libs,apps}/**/*.{graphql,tsx}" hasura/schema.graphql || true
(node:383) UnhandledPromiseRejectionWarning: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /usr/local/lib/node_modules/@graphql-inspector/cli/node_modules/log-symbols/index.js
require() of ES modules is not supported.

To Reproduce Steps to reproduce the behavior:

Using image: node:14-buster on a bitbucket-pipelines.yml

Expected behavior

Add engines key to package and/or list minimum requirements on README

Environment:

  • OS: image: node:14-buster on Bitbucket
  • @graphql-inspector/...: I can get the rest if requested
  • graphql:
  • NodeJS:

Additional context

Was/am confused between graphql-inspector and @graphql-inspector/*

binary64 avatar May 22 '21 17:05 binary64

I have this issue too. Downgrading @graphql-inspector/cli to 2.5.0 fixed it for me.

zoripong avatar May 24 '21 05:05 zoripong

Same issue here

EpicDrakkar avatar May 26 '21 09:05 EpicDrakkar

v2.6.1 should fix it

kamilkisiela avatar May 27 '21 14:05 kamilkisiela

Thanks, I think it helped! But now I get a secondary issue, after running the exact same commands

node:internal/modules/cjs/loader:930
  throw err;
  ^

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

binary64 avatar Jul 27 '21 19:07 binary64