diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts
index 6605372406af4..a99513cba1dad 100644
--- a/src/compiler/checker.ts
+++ b/src/compiler/checker.ts
@@ -8969,7 +8969,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
if (result) {
if (result.pos !== -1 || result.end !== -1) {
if (result === nodes) {
- result = factory.createNodeArray(nodes, nodes.hasTrailingComma);
+ result = factory.createNodeArray(nodes.slice(), nodes.hasTrailingComma);
}
setTextRangePosEnd(result, -1, -1);
}
diff --git a/tests/cases/fourslash/nodeArrayCloneCrash.ts b/tests/cases/fourslash/nodeArrayCloneCrash.ts
new file mode 100644
index 0000000000000..d18a2d7bf8fab
--- /dev/null
+++ b/tests/cases/fourslash/nodeArrayCloneCrash.ts
@@ -0,0 +1,38 @@
+///
+
+// @module: preserve
+
+// @Filename: /TLLineShape.ts
+//// import { createShapePropsMigrationIds } from "./TLShape";
+//// createShapePropsMigrationIds/**/
+
+// @Filename: /TLShape.ts
+//// import { T } from "@tldraw/validate";
+////
+//// /**
+//// * @public
+//// */
+//// export function createShapePropsMigrationIds(): { [k in keyof T]: any } {
+//// return;
+//// }
+
+verify.completions({
+ marker: "",
+ includes: [
+ {
+ name: "createShapePropsMigrationIds",
+ text: "(alias) function createShapePropsMigrationIds(): { [k in keyof T]: any; }\nimport createShapePropsMigrationIds",
+ tags: [{ name: "public", text: undefined }]
+ }
+ ]
+});
+
+goTo.file("/TLShape.ts");
+verify.organizeImports(
+`
+/**
+ * @public
+ */
+export function createShapePropsMigrationIds(): { [k in keyof T]: any } {
+ return;
+}`);
\ No newline at end of file