Login
Remember
Register
Qtsd Q&A
Questions
Unanswered
Tags
Users
Ask a Question
Ask a Question
How to fix "error TS2307: Cannot find module" due to imports from src in type declarations
+3
votes
asked
Mar 7, 2024
in
Others
by
soraly
(
300
points)
This error occurs when we use modules from another micro app
#microfe
#fe
Your answer
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
1
Answer
+1
vote
answered
Mar 7, 2024
by
soraly
(
300
points)
Using:
- Create a file index.d.ts in the app-shell
- add like this
declare module "reactApp/*"
declare module "vueApp/*"
declare module "svelteApp/*"
...
- in tsconfig.json add new like this line
"include": ["src", "index.d.ts"]
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Welcome to Qtsd Q&A, where you can ask questions and receive answers from other members of the community.
...