New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to build in nodejs typescript #187
Comments
Please provide a reduced test case. Closing until this is provided. |
HI @OliverJAsh, I'm not too familiar with the term reduced test case, what am I to provide? |
By reduced test case I mean something like a GitHub repository I can easily clone to reproduce the issue, in the smallest version you can provide. |
Hi @OliverJAsh, I have added the reduced test case. I have left the other dependencies in the package.json file so as to give a good picture of what my configuration looks like. |
Hi @OliverJAsh, I have provided the reduced test case. |
Hi @OliverJAsh, I've fixed the issue. I added the code below to my initialization script and that resolved the issue. My guess is that Request, RequestInnit and Response is defined as types with the fetch which for I guess wasn't globally set when I imported node-fetch. The code just declares fetch, Request, RequestInit and Response as global. ` declare global { ` |
Thank you! This has come up a few times before:
… so I added some documentation here: b8867e9. I raised a PR to fix your problem but it sounds like you figured it out! |
Steps to Reproduce
Observed Behaviour
The build fails with typescript errors saying: Cannot find name "Response", cannot find name "RequestInit"
Expected Behaviour
Expect build to be successful
Technical Notes
Reduced test case in https://github.com/odufuwa-segun/unsplash-backend-reduced-/settings
The text was updated successfully, but these errors were encountered: