Skip to content

RangeError: Maximum call stack size exceeded #5180

@sdgluck

Description

@sdgluck

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

Exits with RangeError when no config file (e.g. package.json?) can be found via traversal up the directory tree:

$ jest --watch
RangeError: Maximum call stack size exceeded
    at String.slice (native)
    at normalizeStringWin32 (path.js:85:22)
    at Object.resolve (path.js:325:20)
    at resolveConfigPathByTraversing (C:\nvm\v8.0.0\node_modules\jest\node_modules\jest-config\build\resolve_config_path.js:57:54)
    at resolveConfigPathByTraversing (C:\nvm\v8.0.0\node_modules\jest\node_modules\jest-config\build\resolve_config_path.js:74:10)
    at resolveConfigPathByTraversing (C:\nvm\v8.0.0\node_modules\jest\node_modules\jest-config\build\resolve_config_path.js:74:10)
    at resolveConfigPathByTraversing (C:\nvm\v8.0.0\node_modules\jest\node_modules\jest-config\build\resolve_config_path.js:74:10)
    at resolveConfigPathByTraversing (C:\nvm\v8.0.0\node_modules\jest\node_modules\jest-config\build\resolve_config_path.js:74:10)
    at resolveConfigPathByTraversing (C:\nvm\v8.0.0\node_modules\jest\node_modules\jest-config\build\resolve_config_path.js:74:10)
    at resolveConfigPathByTraversing (C:\nvm\v8.0.0\node_modules\jest\node_modules\jest-config\build\resolve_config_path.js:74:10)

If the current behavior is a bug, please provide the steps to reproduce and
either a repl.it demo through https://repl.it/languages/jest or a minimal
repository on GitHub that we can yarn install and yarn test.

Run jest in a folder where no Jest config is in the cwd or parent directories.

What is the expected behavior?

e.g. Jest would exit with a message saying "no config found".

Happy to put in a PR for this if we agree on an appropriate message.

Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions