question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

baseUrl not support '.'

See original GitHub issue

Is this a bug report?

Maybe

Version:

react-scripts: 3.0.0-next.68

Error info:

Your project’s baseUrl can only be set to src or node_modules. Create React App does not support other values at this time.

tsconfig

{
  "compilerOptions": {
    ...,
    "baseUrl": "."
  },
}

Question:

Why is baseUrl currently limited to src or node_modules?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:11
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

45reactions
xaviergonzcommented, Apr 23, 2019

I think setting the base url to “.” is safer than setting it to “src”. Imagine you have a file like named “src/react/index.js/ts” (or named like some other famous library) for some reason By setting the baseUrl to “src” you’d need to do import ... from "react", which might lead to confusion. If the baseUrl is set to ‘.’ it would be import ... from "src/react", which is less confusing and less likely to have name clashing.

18reactions
gaearoncommented, Apr 23, 2019

I think the question was about why the support is limited to these values. Seems like a legit question.

Read more comments on GitHub >

github_iconTop Results From Across the Web

paths & baseUrl is not supported in typescript? #16088 - GitHub
I've tried to set up a simple typescript project using the paths and baseUrl path mapping to create shortcuts to folders. Everything seemed...
Read more >
Configuration - Cypress Documentation
This guide is for Cypress 10 and the new JavaScript configuration file format. If you are on an older version of Cypress that...
Read more >
The Document Base URL element - HTML - MDN Web Docs
The HTML element specifies the base URL to use for all relative URLs in a document. There can be only one element in...
Read more >
{{ site.BaseURL | absLangURL }} not working - support - HUGO
HI I have trouble adding the LANG at the end of a URL My config.yaml baseURL: "" languageCode: en-us title: YES theme: toha...
Read more >
jsconfig.json baseUrl is not supported : WEB-43061 - YouTrack
Current solution is to mark desired directories as "resource root". My main issue here is that all projects have either tsconfig.json or jsconfig.json,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found