Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using hasura metadata export #6309

Closed
jon301 opened this issue Dec 5, 2020 · 2 comments
Closed

Error when using hasura metadata export #6309

jon301 opened this issue Dec 5, 2020 · 2 comments

Comments

@jon301
Copy link

jon301 commented Dec 5, 2020

Hi,

I get an error require(...).internalModuleStat is not a function when trying to export metadata with Hasura CLI.

Full debug log:

$ yarn hasura metadata export --log-level debug
DEBU global config file exisits, verifying contents
DEBU global config is pre-set to &cli.GlobalConfig{UUID:"f5fd2a15-54a5-4ea2-9d71-cd856328ee2a", EnableTelemetry:true, ShowUpdateNotification:true, CLIEnvironment:"default"}
DEBU global config: uuid: f5fd2a15-54a5-4ea2-9d71-cd856328ee2a
DEBU global config: enableTelemetry: true
DEBU global config: showUpdateNotification: true
DEBU global config: cliEnvironment: default
DEBU ENV vars read from: /Users/jonjon/work/typefaster-mono/packages/apps/webapp/.env
DEBU graphql engine endpoint: https://typefaster-dev.hasura.app
DEBU graphql engine admin_secret:
DEBU versions: cli: [v1.3.4-beta.1] server: [v1.3.3-cloud.2]
DEBU compatibility check: [true] older cli version might not be compatible with latest server apis, please update cli
DEBU server: uuid: ddf59b50-72d3-44bf-a327-3fbece6d77e2
DEBU response: {"result_type":"TuplesOk","result":[["count"],["1"]]}
DEBU response: {"result_type":"TuplesOk","result":[["count"],["1"]]}
DEBU response: {"version":2,"tables":[]}
DEBU loading plugin cli-ext
DEBU finding plugin manifest files in directory /Users/jonjon/.hasura/plugins/index/plugins
DEBU loading plugins
DEBU output:                                       command="sdl to"
DEBU telemetry: beamed                             fields.time=104.302739ms isError=true
FATA[0009] failed to export metadata: cannot export metadata from server: cannot export actions from metadata: error in converting metadata to sdl: exit status 1: internal/modules/cjs/loader.js:59
const internalModuleStat = function (f) { return require('fs').internalModuleStat(f); };
                                                               ^

TypeError: require(...).internalModuleStat is not a function
    at internalModuleStat (internal/modules/cjs/loader.js:59:64)
    at stat (internal/modules/cjs/loader.js:143:18)
    at Function.Module._findPath (internal/modules/cjs/loader.js:645:16)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:951:27)
    at Function.Module._load (internal/modules/cjs/loader.js:840:27)
    at Module.require (internal/modules/cjs/loader.js:1024:19)
    at Module._preloadModules (internal/modules/cjs/loader.js:1276:12)
    at loadPreloadModules (internal/bootstrap/pre_execution.js:444:5)
    at prepareMainThreadExecution (internal/bootstrap/pre_execution.js:76:3)
    at internal/bootstrap/pkg.js:7:1

It seems like someone already encountered the same issue here : vercel/pkg#954 (comment)

I don't have any NODE_OPTIONS env variable set.

  • Node v14.15.1
  • Yarn 2.4.0
  • Hasura CLI v1.3.4-beta.1
@jon301
Copy link
Author

jon301 commented Dec 5, 2020

Seems like it works when using hasura binary directly and not using Yarn script to execute it.

@jon301 jon301 closed this as completed Dec 5, 2020
@lakshyasharma14
Copy link

lakshyasharma14 commented Feb 16, 2022

@jon301 I am getting the same error while running hasura init hasura --endpoint I am running it from cmd (OS Windows)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants