-
Notifications
You must be signed in to change notification settings - Fork 0
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
Node 14: ReferenceError: regeneratorRuntime is not defined #312
Comments
Hey @1valdis, thanks for reporting this issue! After some initial research, I realised we don't build this package for Node environments, hence why the transpiled code (for async-await) doesn't work. I thought I could solve it by just correctly transpiling the module to support Node but then I realised we use the browser-specific fetch API to do the requests. So I'm afraid some more work will be needed in order to support Node environments. This isn't currently a priority for us as we only use the package in browser environments, but pull requests are highly encouraged and appreciated! |
@ArnaudWeyts considering browser's Fetch API, you may take a look at a popular node-fetch package. I didn't use it myself but it is widely popular and positions itself as a Fetch API implementation for Node environment. |
Same problem. But I don't understand why this package is on npmjs.com if it's only for javascript. |
@mniesen Hey, thanks for commenting on this issue. This package was never created to run on a server. To answer your question: there are tons of packages on npm that only work in certain environments (think UI-libraries etc.), Supporting multiple environments is not a requirement for publishing. |
@ArnaudWeyts you can simply install |
@laurenskling Thanks for the proposal! As I mentioned in the other comment, it's not currently a priority for us to support node in this package. Especially seeing as fetch is getting implemented in node following the official specification: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API#browser_compatibility Fetch should be available starting from Node v18 |
Thanks for the quick response @ArnaudWeyts . |
@laurenskling Nothing more than what is defined in our api documentation, we ourselves only use this package on the frontend side of things (for now). |
I'm trying to use this package on Node server. After doing
npm i @teamleader/api
and creating a file with the simplest piece of code:When trying to run it I'm getting the following error:
Any info on how to solve this?
The text was updated successfully, but these errors were encountered: