Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #8965
Closed
Open
Issue created May 06, 2020 by Administrator@rootContributor

Ejecting writes an absolute path Jest modulePath config

Created by: sdemjanenko

Describe the bug

When using typescript, run eject and then look at the Jest config in package.json. The modulePaths array will have an absolute path instead of being relative to the root dir (e.g. /home/stephen/my-app/src vs <rootDir>/src).

Did you try recovering your dependencies?

This is reproducible from a brand new install.

Which terms did you search for in User Guide?

There is no reference to modulePaths in the user guide.

Environment

Environment Info:

  current version of create-react-app: 3.4.1
  running from /home/stephen/.npm/_npx/1849/lib/node_modules/create-react-app

  System:
    OS: Linux 4.4 Ubuntu 18.04.3 LTS (Bionic Beaver)
    CPU: (8) x64 Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz
  Binaries:
    Node: 12.16.1 - /usr/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.4 - /usr/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: Not Found
  npmPackages:
    react: ^16.13.1 => 16.13.1
    react-dom: ^16.13.1 => 16.13.1
    react-scripts: 3.4.1 => 3.4.1
  npmGlobalPackages:
    create-react-app: Not Found

Steps to reproduce

  1. yarn run eject
  2. Open package.json and look for Jest's modulePaths

Expected behavior

I expected modulePaths to be ["<rootDir>/src"]

Actual behavior

modulePaths was ["/home/stephen/my-app/src"]

Reproducible demo

https://github.com/sdemjanenko/cra-typescript-eject-bug

Follow the Readme

Assignee
Assign to
Time tracking