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 Answer 1

0

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

React native Typescript path alias unable to resolve module

Sign up to request clarification or add additional context in comments.

1 Comment

A link to a solution is welcome, but please ensure your answer is useful without it: add context around the link 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.