The New Way to Build! Introducing ReUI — the developer platform for agentic UI with shadcn/ui
Learn More

How to use baseUrl and paths of tsconfig.js


I can't use baseUrl and paths props of tsconfig.json to improve my imports statements.

I have this in my tsconfig file:

"baseUrl": "./src",
"paths": {
"@app/*": [
"./app/*"
],
},

And I'm trying to import like this:

import DataTable from '@app/shared/components/DataTable/DataTable'

After reload I got this error message:

Failed to compile
./src/app/modules/items/components/States.tsx
Module not found: Can't resolve '@app/shared/components/DataTable/DataTable' in 'C:\Users\rafael.rodrigues\Documents\projects\SigISS_Front\src\app\modules\items\components'


I have the DataTable component in this path:

/src/app/shared/components/DataTable/DataTable.tsx


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (2)


Hi,

Your question is related to the CRA, not to the Metronic itself, cause we haven't changed any base setup from CRA.

Anyway, here is some solutions for alliances in the app:

Regards,
Keenthemes support



What must I do here to achieve this?


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(