fix: revert internal packages requiring esm loading for backward compatible support - #2712
Merged
Conversation
🦋 Changeset detectedLatest commit: f57d723 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2712 +/- ##
==========================================
+ Coverage 89.15% 89.21% +0.05%
==========================================
Files 65 65
Lines 10393 10393
Branches 473 473
==========================================
+ Hits 9266 9272 +6
+ Misses 1096 1089 -7
- Partials 31 32 +1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
zimeg
force-pushed
the
clack/revert-esm-only-deps
branch
2 times, most recently
from
August 27, 2026 18:37
6bd4e94 to
e2aadfd
Compare
…atible support
p-queue (ESM-only since v7) and p-retry (ESM-only since v5) ship as pure ESM
("type": "module"), which made the CommonJS builds of @slack/web-api and
@slack/webhook throw ERR_REQUIRE_ESM under require() on the pre-require(esm)
Node.js in the declared ">= 20" support range (Node 20.0-20.18). Pin both back
to their last CommonJS releases — p-queue@^6.6.2 and p-retry@^4.6.2 — matching
what shipped in the working @slack/web-api@8.0.0. These are the terminal
versions of their CJS majors, so the caret ranges resolve to exactly those
releases while staying major-gated against the ESM-only successors; matching
Dependabot ignore rules for web-api keep an accidental bump from re-breaking it.
No public API or runtime behavior change: p-queue/p-retry are internal
implementation details, RetryOptions is defined via the `retry` package (not
p-retry), and only options common to these versions are used.
Fixes #2711
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
zimeg
force-pushed
the
clack/revert-esm-only-deps
branch
from
August 27, 2026 18:39
e2aadfd to
3bd4240
Compare
zimeg
marked this pull request as ready for review
August 27, 2026 18:42
WilliamBergamin
approved these changes
Aug 27, 2026
Comment on lines
+56
to
+57
| "p-queue": "^6.6.2", | ||
| "p-retry": "^4.6.2", |
Condense the p-queue/p-retry ignore rationale to a single line per block, keeping the #2711 reference inline. Co-Authored-By: William Bergamin <25348381+WilliamBergamin@users.noreply.github.com> Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request restores CommonJS-loadable dependency versions so
require('@slack/web-api')andrequire('@slack/webhook')work on every Node.js version in the declaredengines.node: ">= 20"range. Fixes #2711.@slack/web-api@8.1.0throwsERR_REQUIRE_ESMwhenrequire()d on Node 20 versions beforerequire(esm)was unflagged (i.e. Node 20.0–20.18; unflagged by default only in 20.19+ / 22.12+).@slack/web-api@8.0.0loads fine because it shipped with the older CommonJS deps.p-queueandp-retryeach went pure ESM ("type": "module") at a major that our ranges silently crossed:p-queue— CJS through6.6.2; ESM-only from v7.0.0. We were on^9.p-retry— CJS through4.6.2; ESM-only from v5.0.0. We were on^8(v8.0.0 also raised the engine floor to Node 22).p-queue@^6.6.2andp-retry@^4.6.2— matching what shipped in the working@slack/web-api@8.0.0.6.6.2and4.6.2are the terminal versions of their CJS majors, so the caret ranges resolve to exactly those releases while staying major-gated against the ESM-only successors. Matching Dependabotignorerules are added forweb-api(mirroring the existing rule forwebhook) so a future bump can't silently re-break CJS loading.p-queue/p-retryare internal implementation details — never re-exported. The publicRetryOptionstype is defined via theretrypackage, notp-retry, and the SDK only uses options common to these versions (AbortError,retries,factor,minTimeout,maxTimeout,randomize). Consumers on Node 20.19+/22.12+ see no change; consumers on plain Node 20 go from broken → working.Testing
Simulate the pre-
require(esm)Node.js behavior with the flag from the issue repro:Requirements