I’m working on a React & Nodejs smart-mirror, both using TypeScript and using a shared directory to store the mirror’s modules.
The project structure is as follows;
└── root
├── api (node)
├── node_modules
├── client
├── node_modules
├── modules
├── moduleName
├── index.tsx
├── helper.ts
├── types.ts
The helper file contains an express route, which is dynamically loaded, the index is the react component and the types is shared.
The api works works fine but the react app throws errors when the helper file contains the express router, or references the api code at all.
The react application then throws errors requiring modules inside the node_modules from the api when the helper code isn’t referenced in the react app at all, only the index file.
I have created this already without typescript but as soon as I added typescript the errors started to happen.
I have tried many different methods to exclude the helper files and even setting the react app to only load .tsx but I am still receiving the same errors.
Any help is much appreciated.