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

cannot find name URL #37

Closed
ashiishme opened this issue Nov 30, 2021 · 5 comments
Closed

cannot find name URL #37

ashiishme opened this issue Nov 30, 2021 · 5 comments

Comments

@ashiishme
Copy link

ashiishme commented Nov 30, 2021

The _types.ts & gotenberg.ts is missing the URL import which throws error when building the project ( hopefully I think only backend ) that depends on Gotenberg service.

Error: node_modules/gotenberg-js-client/dist-types/_types.d.ts(68,30): error TS2304: Cannot find name 'URL'.
Error: node_modules/gotenberg-js-client/dist-types/gotenberg.d.ts(3,57): error TS2304: Cannot find name 'URL'.

To re-create:

  • Use gotenberg-js-client on backend project
  • Build the project
@yumauri
Copy link
Owner

yumauri commented Nov 30, 2021

Hello!
URL class is available globally in Node.js since version 10, but still wasn't added to node types ._.
As a temporary solution you can add "dom" to your tsconfig.json libs.

@ashiishme
Copy link
Author

Thank you for giving more insight of the issue. Is there any other alternatives rather than using "dom"?

@yumauri
Copy link
Owner

yumauri commented Nov 30, 2021

I tried to add

import { URL } from 'url'

to where URL is used.

Can you try version 0.7.1, will it work out for you?

@yumauri
Copy link
Owner

yumauri commented Nov 30, 2021

BTW, for now, this is backend only client, because it heavily relies on Node.js internals

@ashiishme
Copy link
Author

@yumauri Thank you for the new release. Yes, it resolved the TS complain about URL.

@yumauri yumauri closed this as completed Dec 1, 2021
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