Cannot find module or its corresponding type declarations, installing bootstrap theme to react project

20 Views Asked by At

I recently bought a bootstrap theme [https://themes.getbootstrap.com/product/appstack-react-admin-dashboard-template/].

I have a react project which is intended to use that theme as a UI library.

I have installed the theme in my react app via NPM. I can see in my node modules that i have the different components available.

I tried to import one of the components with this line of code:

import Navbar from "../../../node_modules/appstack-react/src/components/navbar";

Which gives me the following error:

Cannot find module '../../../node_modules/appstack-react/src/components/navbar' or its corresponding type declarations.ts(2307)

Here is where i am lost, i have read and i think i understand that i need to add a custom type declarations file and add something to my tsconfig.json.

WHAT i am supposed to add in these files to make this work i have no idea.

Could somebody please guide me as to what i need to add to make this work or if im totally wrong guide me to the correct way?

If you need any additional information please let me know.

I am adding an image that shows the folder structure within the bootstrap project enter image description here

What i have tried is explained above

0

There are 0 best solutions below