When running in an ESM environment, shared-ini-file-loader(that I know of, but it's possible other packages are outputting incorrect ESM code as well) provides a broken entryfile, resulting in an error with build processes which are strict about this thing in general:
✘ [ERROR] No matching export in "../../node_modules/@smithy/shared-ini-file-loader/dist-es/index.js" for import "getSSOTokenFromFile"
../../node_modules/@aws-sdk/credential-provider-sso/dist-es/resolveSSOCredentials.js:4:9:
4 │ import { getSSOTokenFromFile } from "@smithy/shared-ini-file-loader";
The reason for this is that in ESM, file extensions are mandatory, but the build process doesn't append these for the dist-es build. This is what the current @smithy/shared-ini-file-loader/dist-es/index.js looks like:
export * from "./getHomeDir";
export * from "./getProfileName";
export * from "./getSSOTokenFilepath";
export * from "./getSSOTokenFromFile";
export * from "./loadSharedConfigFiles";
export * from "./loadSsoSessionData";
export * from "./parseKnownFiles";
export * from "./types";
Manually adding the .js file extensions in my own node_modules folder fixes this, so this is 100% the issue for the build error. Correct ESM output should be:
export * from "./getHomeDir.js";
export * from "./getProfileName.js";
export * from "./getSSOTokenFilepath.js";
export * from "./getSSOTokenFromFile.js";
export * from "./loadSharedConfigFiles.js";
export * from "./loadSsoSessionData.js";
export * from "./parseKnownFiles.js";
export * from "./types.js";
Edit: may be an issue with the bundler, since running with a simple node command works, but to err on the side of caution, the es export should still contain the proper extensions.
When running in an ESM environment,
shared-ini-file-loader
(that I know of, but it's possible other packages are outputting incorrect ESM code as well) provides a broken entryfile, resulting in an error with build processes which are strict about this thing in general:The reason for this is that in ESM, file extensions are mandatory, but the build process doesn't append these for the
dist-es
build. This is what the current@smithy/shared-ini-file-loader/dist-es/index.js
looks like:Manually adding the
.js
file extensions in my ownnode_modules
folder fixes this, so this is 100% the issue for the build error. Correct ESM output should be:Edit: may be an issue with the bundler, since running with a simple node command works, but to err on the side of caution, the es export should still contain the proper extensions.