From 64960e943c25eee93f07fc69ff4a52da09d40bde Mon Sep 17 00:00:00 2001 From: anastasiaguspan Date: Mon, 31 Aug 2026 12:57:17 -0400 Subject: [PATCH 1/6] Add KB article: TypeScript build fails for CommonJS with verbatimModuleSyntax Customers following the CommonJS setup in the TS SDK integration guide hit TS1295/TS1287 if their tsconfig sets verbatimModuleSyntax: true. Reproduced against weave 0.16.3 / TypeScript 6.0.3; fix is to set it back to false. Ref DOCS-2554. --- ...cript-build-fails-after-commonjs-setup.mdx | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 support/weave/articles/typescript-build-fails-after-commonjs-setup.mdx diff --git a/support/weave/articles/typescript-build-fails-after-commonjs-setup.mdx b/support/weave/articles/typescript-build-fails-after-commonjs-setup.mdx new file mode 100644 index 0000000000..79c294be09 --- /dev/null +++ b/support/weave/articles/typescript-build-fails-after-commonjs-setup.mdx @@ -0,0 +1,27 @@ +--- +title: "Why does my Weave TypeScript build fail for CommonJS format?" +--- + +## `TS1295` and `TS1287`: ECMAScript imports and exports cannot be written in a CommonJS file + +If your `tsconfig.json` file sets `"verbatimModuleSyntax": true`, compiling a CommonJS project (per the [TypeScript SDK integration guide](/weave/guides/integrations/js)) fails with: + +```text +error TS1295: ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. +error TS1287: A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled. +``` + +The setting defaults to `false`, which the TypeScript SDK integration guide assumes. + +Set it back to `false` alongside your CommonJS `module` setting: + +```json lines +{ + "compilerOptions": { + "module": "CommonJS", + "verbatimModuleSyntax": false + } +} +``` + +`"verbatimModuleSyntax": false` allows ESM-style `import`/`export` syntax in your source files while TypeScript still emits CommonJS output. For details, see [TypeScript - Verbatim Module Syntax](https://www.typescriptlang.org/tsconfig/#verbatimModuleSyntax). From 11360b4b0bea840614f83f7d216582841256b8cf Mon Sep 17 00:00:00 2001 From: "wandb-docs-pr-writer[bot]" Date: Mon, 31 Aug 2026 16:58:19 +0000 Subject: [PATCH 2/6] chore: regenerate support tag pages --- support.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support.mdx b/support.mdx index 46b219037f..bf98d2b83b 100644 --- a/support.mdx +++ b/support.mdx @@ -52,7 +52,7 @@ and the W&B community. {/* AUTO-GENERATED: counts */} - 18 articles · 11 tags + 19 articles · 11 tags {/* END AUTO-GENERATED: counts */} From 0f52f94d36e43cc4606573f3e24b16cf6a9a2f50 Mon Sep 17 00:00:00 2001 From: anastasiaguspan Date: Mon, 31 Aug 2026 13:00:28 -0400 Subject: [PATCH 3/6] fix --- .../articles/typescript-build-fails-after-commonjs-setup.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/weave/articles/typescript-build-fails-after-commonjs-setup.mdx b/support/weave/articles/typescript-build-fails-after-commonjs-setup.mdx index 79c294be09..4591232464 100644 --- a/support/weave/articles/typescript-build-fails-after-commonjs-setup.mdx +++ b/support/weave/articles/typescript-build-fails-after-commonjs-setup.mdx @@ -4,7 +4,7 @@ title: "Why does my Weave TypeScript build fail for CommonJS format?" ## `TS1295` and `TS1287`: ECMAScript imports and exports cannot be written in a CommonJS file -If your `tsconfig.json` file sets `"verbatimModuleSyntax": true`, compiling a CommonJS project (per the [TypeScript SDK integration guide](/weave/guides/integrations/js)) fails with: +If your `tsconfig.json` file sets `"verbatimModuleSyntax": true`, compiling a W&B Weave CommonJS project (per the [TypeScript SDK integration guide](/weave/guides/integrations/js)) fails with: ```text error TS1295: ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. From 4dc738ed7ea93bca8638d5fe5e3ec782a74f28a7 Mon Sep 17 00:00:00 2001 From: anastasiaguspan Date: Mon, 31 Aug 2026 13:26:48 -0400 Subject: [PATCH 4/6] Tag KB article with TypeScript keyword Adds keywords: ["TypeScript"] so the nav generator creates a category for it; no existing tag (System Info, weave.op, etc.) fit a build/tsconfig issue. --- .../articles/typescript-build-fails-after-commonjs-setup.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/support/weave/articles/typescript-build-fails-after-commonjs-setup.mdx b/support/weave/articles/typescript-build-fails-after-commonjs-setup.mdx index 4591232464..084bccd2d0 100644 --- a/support/weave/articles/typescript-build-fails-after-commonjs-setup.mdx +++ b/support/weave/articles/typescript-build-fails-after-commonjs-setup.mdx @@ -1,5 +1,6 @@ --- title: "Why does my Weave TypeScript build fail for CommonJS format?" +keywords: ["TypeScript"] --- ## `TS1295` and `TS1287`: ECMAScript imports and exports cannot be written in a CommonJS file From de0697b4f392659421ec32b967b5708458f54553 Mon Sep 17 00:00:00 2001 From: "wandb-docs-pr-writer[bot]" Date: Mon, 31 Aug 2026 17:27:40 +0000 Subject: [PATCH 5/6] chore: regenerate support tag pages --- support.mdx | 2 +- support/weave.mdx | 3 +++ .../typescript-build-fails-after-commonjs-setup.mdx | 4 ++++ support/weave/tags/typescript.mdx | 10 ++++++++++ 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 support/weave/tags/typescript.mdx diff --git a/support.mdx b/support.mdx index bf98d2b83b..811d6e9419 100644 --- a/support.mdx +++ b/support.mdx @@ -52,7 +52,7 @@ and the W&B community. {/* AUTO-GENERATED: counts */} - 19 articles · 11 tags + 19 articles · 12 tags {/* END AUTO-GENERATED: counts */} diff --git a/support/weave.mdx b/support/weave.mdx index 8a0a17c5af..da0991fb47 100644 --- a/support/weave.mdx +++ b/support/weave.mdx @@ -33,6 +33,9 @@ template: "docengine-site/templates/support_product_index.mdx.j2" 2 articles + + 1 article + 2 articles diff --git a/support/weave/articles/typescript-build-fails-after-commonjs-setup.mdx b/support/weave/articles/typescript-build-fails-after-commonjs-setup.mdx index 084bccd2d0..432d4c288e 100644 --- a/support/weave/articles/typescript-build-fails-after-commonjs-setup.mdx +++ b/support/weave/articles/typescript-build-fails-after-commonjs-setup.mdx @@ -26,3 +26,7 @@ Set it back to `false` alongside your CommonJS `module` setting: ``` `"verbatimModuleSyntax": false` allows ESM-style `import`/`export` syntax in your source files while TypeScript still emits CommonJS output. For details, see [TypeScript - Verbatim Module Syntax](https://www.typescriptlang.org/tsconfig/#verbatimModuleSyntax). + +{/* AUTO-GENERATED: tab badges */} +[TypeScript](/support/weave/tags/typescript) +{/* END AUTO-GENERATED: tab badges */} \ No newline at end of file diff --git a/support/weave/tags/typescript.mdx b/support/weave/tags/typescript.mdx new file mode 100644 index 0000000000..46adfe5540 --- /dev/null +++ b/support/weave/tags/typescript.mdx @@ -0,0 +1,10 @@ +--- +title: "TypeScript" +tag: "1" +generator: "knowledgebase-nav" +template: "docengine-site/templates/support_tag.mdx.j2" +--- + + + TS1295 and TS1287: ECMAScript imports and exports cannot be written in a CommonJS file If your tsconfig.json file sets " ... + From 2c99dd9b2f0d8ee5d91dd34ca9a9ebaff787a183 Mon Sep 17 00:00:00 2001 From: Anastasia Guspan Date: Tue, 1 Sep 2026 16:55:11 -0400 Subject: [PATCH 6/6] Apply suggestion from @anastasiaguspan --- .../articles/typescript-build-fails-after-commonjs-setup.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/weave/articles/typescript-build-fails-after-commonjs-setup.mdx b/support/weave/articles/typescript-build-fails-after-commonjs-setup.mdx index 432d4c288e..ecc07035bb 100644 --- a/support/weave/articles/typescript-build-fails-after-commonjs-setup.mdx +++ b/support/weave/articles/typescript-build-fails-after-commonjs-setup.mdx @@ -14,7 +14,7 @@ error TS1287: A top-level 'export' modifier cannot be used on value declarations The setting defaults to `false`, which the TypeScript SDK integration guide assumes. -Set it back to `false` alongside your CommonJS `module` setting: +Set the `verbatimModuleSyntax` field to `false` alongside your CommonJS `module` setting: ```json lines {