Skip to content
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

Typescript error: Cannot find name 'Response' #96

Closed
cassus opened this issue Oct 5, 2019 · 2 comments
Closed

Typescript error: Cannot find name 'Response' #96

cassus opened this issue Oct 5, 2019 · 2 comments

Comments

@cassus
Copy link

cassus commented Oct 5, 2019

node_modules/ynab/dist/api.d.ts:29:40 - error TS2304: Cannot find name 'Response'.

29     (url: string, init?: any): Promise<Response>;
                                          ~~~~~~~~

Typescript version: 3.6.3

@bradymholt
Copy link
Member

bradymholt commented Oct 8, 2019

Hi @cassus - Can you share your tsconfig.json contents?

In tsconfig.json, you must use a target of at least "ES5" or greater. Also, if you overwrite the default "lib" setting, you must ensure it contains "dom".

For example:

"target": "ES5",
"lib": ["dom", "es5", "scripthost"],

@cassus
Copy link
Author

cassus commented Oct 9, 2019

Thanks, this was it!

thomotron added a commit to thomotron/up-to-ynab that referenced this issue Dec 28, 2021
Compiler would complain that Response is not available to the runtime
when building the app. Explicitly including the DOM library was
recommended by the YNAB team in ynab/ynab-sdk-js#96.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants