-
-
Notifications
You must be signed in to change notification settings - Fork 369
Description
Describe the bug
Issue #4013 has been closed and considered fixed, but when using tsc@5.7.3 and @module-federation/sdk@0.21.2, I still get the error when running typescript compilation with the --skipLibCheck false option (required for my use-case):
node_modules/@module-federation/runtime-core/node_modules/@module-federation/sdk/dist/src/constant.d.ts:10:14 - error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type. 10 readonly [NameTransformSymbol.AT]: "scope_"; ~~~~~~~~~~~~~~~~~~~~~~~~ node_modules/@module-federation/runtime-core/node_modules/@module-federation/sdk/dist/src/constant.d.ts:11:14 - error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type. 11 readonly [NameTransformSymbol.HYPHEN]: "_"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ node_modules/@module-federation/runtime-core/node_modules/@module-federation/sdk/dist/src/constant.d.ts:12:14 - error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type. 12 readonly [NameTransformSymbol.SLASH]: "__"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Found 3 errors in the same file, starting at: node_modules/@module-federation/runtime-core/node_modules/@module-federation/sdk/dist/src/constant.d.ts:10
Is there anything I am missing, or is the fix of the issue mentioned above only a partial fix, or incorrectly reflected in the last published types ?
FTR this is fixed with the given yarn patch on version 0.21.2 :
`diff --git a/dist/src/constant.d.ts b/dist/src/constant.d.ts
index e1366a27b825cc54cfa07b7cefde3df894018702..111da427fd8775c687e652d56e26c9e85509c7c6 100644
--- a/dist/src/constant.d.ts
+++ b/dist/src/constant.d.ts
@@ -2,9 +2,9 @@ export declare const FederationModuleManifest = "federation-manifest.json";
export declare const MANIFEST_EXT = ".json";
export declare const BROWSER_LOG_KEY = "FEDERATION_DEBUG";
export declare const NameTransformSymbol: {
- AT: string;
- HYPHEN: string;
- SLASH: string;
- readonly AT: unique symbol;
- readonly HYPHEN: unique symbol;
- readonly SLASH: unique symbol;
};
export declare const NameTransformMap: {
readonly [NameTransformSymbol.AT]: "scope_";`
Reproduction
- Include the
@module-federation/sdk@0.21.2as a dependency in your project, use it in the code, andrun yarn tsc --skipLibCheck false
Used Package Manager
yarn
System Info
System:
OS: macOS 26.0.1
CPU: (12) arm64 Apple M3 Pro
Memory: 494.31 MB / 36.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.19.0 - /opt/homebrew/opt/node@20/bin/node
Yarn: 4.8.1 - /opt/homebrew/bin/yarn
npm: 10.8.2 - /opt/homebrew/opt/node@20/bin/npm
Browsers:
Chrome: 142.0.7444.60
Firefox: 140.4.0
Safari: 26.0.1Validations
- Read the docs.
- Read the common issues list.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Module federation issue and not a framework-specific issue.
- The provided reproduction is a minimal reproducible example of the bug.