diff --git a/.changeset/icy-vans-kneel.md b/.changeset/icy-vans-kneel.md new file mode 100644 index 0000000000..9a117bc02a --- /dev/null +++ b/.changeset/icy-vans-kneel.md @@ -0,0 +1,5 @@ +--- +"@medusajs/utils": patch +--- + +fix(utils): fix error when generating migrations for a module with existing snapshot diff --git a/packages/core/utils/src/migrations/index.ts b/packages/core/utils/src/migrations/index.ts index d0376dfa6d..e819c4dca2 100644 --- a/packages/core/utils/src/migrations/index.ts +++ b/packages/core/utils/src/migrations/index.ts @@ -210,7 +210,7 @@ export class Migrations extends EventEmitter { ) if (snapshotFile) { - const absoluteName = join(snapshotFile.path, snapshotFile.name) + const absoluteName = join(snapshotFile.parentPath, snapshotFile.name) if (absoluteName !== snapshotPath) { await rename(absoluteName, snapshotPath) }