You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of smithy-lang/smithy-typescript#1146
(details at smithy-lang/smithy-typescript#1113)
the CommonJS export for many (all?) `@smithy/*` packages is now an esbuild
bundle -- all in `dist-cjs/index.js`. That means that subfile patching like this
no longer works:
```js
const v3SmithyMiddlewareStackFile = new InstrumentationNodeModuleFile(
'@smithy/middleware-stack/dist-cjs/MiddlewareStack.js',
['>=1.0.1'],
this.patchV3ConstructStack.bind(this),
this.unpatchV3ConstructStack.bind(this)
);
```
In our case this breaks as of `@smithy/[email protected]` released
2024-01-17T22:26:42.432Z. This is considered a non-breaking change, so the
dependency ranges for earlier released versions of `@smithy/smithy-client` will
pick this up.
A fix is to change the `@smithy/middleware-stack` patching to be on the top-level
module exports. Because the `constructStack` field is only available as a getter
we cannot use shimmer (InstrumentationBase._wrap). Instead this returns a new
`moduleExports` object with a new getter that shims the call.
0 commit comments