Skip to content

tsconfig can't be read with some compilerOptions.baseUrl and react-scripts@4.0.1 #10410

Open
@ValeryVS

Description

@ValeryVS

Describe the bug

Add "baseUrl": "src", to compilerOptions of tsconfig.

src/index.tsx
  Line 0:  Parsing error: Cannot read file '/users/tasogare/projects/sdc-repos/www/services/map-editor/client/services/remote-control-cloud/client/tsconfig.json'

Did you try recovering your dependencies?

It works without baseUrl, or with "baseUrl": "./".

Which terms did you search for in User Guide?

baseUrl

Environment

% npx create-react-app --info
npx: установлен 67 в 7.022s

Environment Info:

  current version of create-react-app: 4.0.1
  running from /Users/tasogare/.npm/_npx/69119/lib/node_modules/create-react-app

  System:
    OS: macOS 10.15.7
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
  Binaries:
    Node: 12.18.3 - ~/.nvm/versions/node/v12.18.3/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.8 - ~/.nvm/versions/node/v12.18.3/bin/npm
  Browsers:
    Chrome: Not Found
    Edge: Not Found
    Firefox: 72.0.2
    Safari: 14.0.2
  npmPackages:
    react:  16.13.1
    react-dom:  16.13.1
    react-scripts: 4.0.1 => 4.0.1
  npmGlobalPackages:
    create-react-app: Not Found

Steps to reproduce

(Write your steps here:)

  1. Add "baseUrl": "src", to compilerOptions of tsconfig.
  2. Run npm start

Expected behavior

baseUrl accepted and imports from src/features/map/index.tsx can be written as from 'features/map'.

Actual behavior

Project can't be built.

Reproducible demo


Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions