0

I am currently converting relative paths to absolute paths in my React-Native app and it triggers the following error: Error response to absolute import

And I have set up my tsconfig.json as follows:

{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "@buttons/*": ["src/components/buttons/*"]
    },
    "jsx": "react",
    "resolveJsonModule": true
  }
}

The following statement is how it looks in the file that I am importing it in:

import {CoreButton} from '@buttons/CoreButton';

Any ideas or suggestions would be amazing :)

1 Answers1

0

The solution to this problem has been found at the following link:

React native Typescript path alias unable to resolve module

  • A link to a solution is welcome, but please ensure your answer is useful without it: [add context around the link](https://meta.stackexchange.com/a/8259) so your fellow users will have some idea what it is and why it’s there, then quote the most relevant part of the page you're linking to in case the target page is unavailable. [Answers that are little more than a link may be deleted](https://stackoverflow.com/help/deleted-answers). – Tyler2P Jul 09 '22 at 09:08