Correct typing for index file #1229
Unanswered
SalahAdDin
asked this question in
Q&A
Replies: 2 comments 2 replies
-
Hey, @SalahAdDin. This library is written in TypeScript and ships with type definitions. I think there may be something wrong with the |
Beta Was this translation helpful? Give feedback.
0 replies
-
@kettanaito Did you check it with the tutorial i referenced here? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Scope
Improves an existing behavior
Compatibility
Feature description
After following a lot of tutorials, I understood I need a index file for the mocks folder when I want to user it also for SSR (NextJS).
So, I got this code trying to fix almost every error Typescript gave me:
Even with it, I still have an error:
Unexpected require().
It is also giving the following problem:
TypeError: server.listen is not a function
Looking for fixing that bug I tried the next:
And:
Finally, to solve them I opted for declaring them inside of the function:
Fixing any possible problem, but never used on the existing tutorials(for instance), cause they don't implement typescript.
How should we implement it then?
Thank you
Beta Was this translation helpful? Give feedback.
All reactions