Repository navigation
Description
What happened
10.8.0 changed jsii.tsc: { outDir: "lib", rootDir: "src" } to jsii.tsconfig + validateTsconfig in package.json. That drops jsii.tsc.outDir, which downstream consumers need in order to map the shipped lib/*.d.ts paths back to the src/... symbol ids recorded in the assembly.
The consequence is that any tool transliterating TypeScript that imports constructs now emits incorrect Java and Go imports:
| language | expected | actual on 10.8.0 |
|---|---|---|
| Java | import software.constructs.Construct; |
import constructs.Construct; |
| Go | "github.com/aws/constructs-go/constructs" |
"github.com/aws-samples/dummy/constructs" |
Python and C# are unaffected, but only coincidentally — rosetta's fallback name derivation (constructs, Constructs) happens to match the correct target names for those two languages.
The failure is silent: the assembly loads fine and the lookup just degrades to "not a jsii symbol", so the output looks plausible.
Reproduction
mkdir repro && cd repro && npm init -y
npm install [email protected] [email protected]
cat > snippet.ts <<'EOF'
import { Construct } from "constructs";
export class Foo extends Construct {
constructor(scope: Construct, id: string) { super(scope, id); }
}
EOF
cat > run.js <<'EOF'
const rosetta = require("jsii-rosetta");
const fs = require("fs"), path = require("path");
const file = {
contents: fs.readFileSync(path.join(__dirname, "snippet.ts"), "utf8"),
fileName: path.join(__dirname, "snippet.ts"),
};
console.log("constructs", require("constructs/package.json").version);
for (const [name, V] of [["java", rosetta.JavaVisitor], ["go", rosetta.GoVisitor]]) {
const { translation } = rosetta.translateTypeScript(file, new V(), {});
console.log(" ", name.padEnd(4), "->", translation.split("\n").find((l) => /constructs/i.test(l)).trim());
}
EOF
node run.js
npm install [email protected] && node run.js10.7.2 is correct; 10.8.0 is not. Patching jsii.tsc back into the installed 10.8.0 package.json restores correct output with nothing else changed, which isolates it to this field.
Reproduced on both [email protected] and [email protected], so it is not resolved by consumers upgrading to the jsii 6.x toolchain.
Note
The underlying gap is in jsii itself: symbolIdentifier() falls back to assembly.metadata.tscRootDir when jsii.tsc.rootDir is absent, but has no equivalent fallback for outDir, and tsconfig.json is not published in the npm tarball. I have filed that separately as aws/jsii-compiler#2740.
Raising it here as well since constructs is likely the most widely consumed package to adopt jsii.tsconfig, and it may be worth restoring jsii.tsc.outDir/rootDir in a patch release until the jsii-side fix ships.
Environment
constructs10.8.0 (broken) vs 10.7.2 (fine)jsii-rosetta6.0.7 /jsii6.0.7, also 5.9.39 / 5.9.x- Node.js v22.22.2
Activity
mrgrain commentedon Aug 3, 2026
Thanks for the report! Deprecated 10.8.0 for now. Working on a compiler fix and will then release
constructswithjsii.tsc.outDir.There's also going to be a fix in
jsii-rosettaI think.fix: dropping jsii.tsc.outDir breaks Java/Go transliteration for jsii…
fix: dropping jsii.tsc.outDir breaks Java/Go transliteration for jsii…
mrgrain commentedon Aug 3, 2026
10.8.1 released and should work with existing rosetta versions. But we also have new versions of
jsii-rosettaout to address the issue better. Plusjsii-compliernow has the proposed fix.mrgrain commentedon Aug 3, 2026
@jsteinich Let me know if this solves it for you!
jsteinich commentedon Aug 7, 2026
@mrgrain Tests are working locally. Thanks.
fix: wrong Java and Go names for libraries that manage their own tsco…