Skip to content

fs__WEBPACK_IMPORTED_MODULE_1___default.a.realpathSync is not a function #118

@hongbo-miao

Description

@hongbo-miao

I am using graphql.macro to import .graphql file in a create-react-app app. It works well.

However, when I try to run a Cypress test, I got error

The following error originated from your test code, not from Cypress.

fs__WEBPACK_IMPORTED_MODULE_1___default.a.realpathSync is not a function

When Cypress detects uncaught errors originating from your test code it will automatically fail the current test.

Cypress could not associate this error to any specific test.

We dynamically generated a new test to display this failure.

Check your console for the stack trace or click this message to see where it originated from.
client/node_modules/graphql.macro/es/utils/resolveImportPath.js:3:13

  1 | import path from 'path';
  2 | import fs from 'fs';
> 3 | var CMD = fs.realpathSync(process.cwd());
    |             ^
  4 | var jsconfigPath = path.resolve(CMD, 'jsconfig.json');
  5 | var jsconfigInclude;
  6 | 

image

I know Cypress is using Mocha internally.
Any help will be great. Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions