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
"module" entry points to web bundle #45
Comments
I am also running into this issue. I just manually changed the After changing I added a rule to the
I suspect if this bug is ever completed, this may have to change, but for now... this is working for me in case anyone else finds this thread. |
Unfortunately this isn't a problem we can fix ourselves. This would be a problem with the build system, which is not maintained anymore. This will get fixed once we switch to using pure ESM + seperate types |
We are starting to migrate away from Pika, and towards using esbuild to generate the different bundles, and tsc to generate the types. We will be able to get this addressed in a new major version |
#159 Should help get this sorted out In the meantime, you can always load the package from a CDN: import { sign, verify } from "https://esm.sh/@octokit/[email protected]"; |
What happened?
I'm bundling my node.js code with webpack for serverless.
With bundled
@octokit/webhooks-methods
, my code doesn't run and throws an error:Exception: ReferenceError: crypto is not defined
.What did you expect to happen?
Code generated by webpack to run.
What the problem might be
@octokit/webhooks-methods
defines these entries inpackage.json
:Webpack favours
module
(see webpack/webpack#5756 ) because it helps with e.g. better tree shaking, but themodule
entry here points to thedist-web/index.js
file which doesn't includecrypto
andbuffer
imports.IMO the
module
entry should be renamed tobrowser
.The text was updated successfully, but these errors were encountered: