-
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
[CheckJs Error]: Cannot find name 'Buffer' #3
Comments
I've used
In browsers / Deno, we can use I think I'll probably add a method directly to Regarding the error
I'd just disable the error for now. |
Created a follow up issues for:
|
Already disabled by #9 I posted an issue in StackOverflow (did not find any issue regarding this in TypeScript's GitHub in a quick search) to see if it's possible to Texted @G-Rath because I saw him using it here for example: https://github.com/octokit/webhooks.js/blame/aad9b74ba90f8ca633c811231f1f566f59e241bd/test/typescript-validate.ts#L19 |
I formatted it like that as capturing the expected comment, but it doesn't actually interact with You should be able to resolve this without
Yes, I would recommend that - that suggestion actually comes from TypeScript; the only reason not to do it is if you're not in a node env and so can't use node globals such as Even then those globals are usually always polyfilable, so it's typically fine to use (Aside from the globals, you can avoid everything else brought in by |
@G-Rath thanks for the detailed explanation. As always, is a pleasure reading you.
It's fine, I just wanted to know if it works but was not working to me or was just info added to the comment Seems like @gr2m wants to give support to other environments as Browser and Deno so... maybe it's ok to not use @types/node and point to a cross-platform solution? What's your opinion on that @G-Rath |
that's exactly the reason why I would not add it. @octoherd scripts should run universally in Node 12+/Deno/evergreen Browsers |
But if you really don't want to use |
I wouldn't, because if we just use In this particular case I will encapsulate the base64 encoding into a plugin, so this will be a non-problem for scripts after that. |
Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
.I'm not familiar with working with JavaScript with checkJs, do you think we should install
@types/node
as VS Code suggests?The text was updated successfully, but these errors were encountered: