-
Notifications
You must be signed in to change notification settings - Fork 12
Closed
Labels
Status: BlockedSome technical or requirement is blocking the issueSome technical or requirement is blocking the issueType: BugSomething isn't working as documentedSomething isn't working as documented
Description
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 in package.json:
"main": "dist-node/index.js",
"module": "dist-web/index.js",
"source": "dist-src/index.js",
"types": "dist-types/index.d.ts",Webpack favours module (see webpack/webpack#5756 ) because it helps with e.g. better tree shaking, but the module entry here points to the dist-web/index.js file which doesn't include crypto and buffer imports.
IMO the module entry should be renamed to browser.
mpielvitori and korywka
Metadata
Metadata
Assignees
Labels
Status: BlockedSome technical or requirement is blocking the issueSome technical or requirement is blocking the issueType: BugSomething isn't working as documentedSomething isn't working as documented