@wopr-network/platform-core 1.14.4 → 1.14.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -194,7 +194,11 @@ export async function runAuthMigrations() {
194
194
  try {
195
195
  ({ getMigrations } = (await import("better-auth/db/migration")));
196
196
  }
197
- catch {
197
+ catch (err) {
198
+ // Only fall back if the module path doesn't exist (ERR_MODULE_NOT_FOUND / ERR_PACKAGE_PATH_NOT_EXPORTED)
199
+ const code = err.code;
200
+ if (code !== "ERR_MODULE_NOT_FOUND" && code !== "ERR_PACKAGE_PATH_NOT_EXPORTED")
201
+ throw err;
198
202
  ({ getMigrations } = (await import("better-auth/db")));
199
203
  }
200
204
  const { runMigrations } = await getMigrations(authOptions(_config));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wopr-network/platform-core",
3
- "version": "1.14.4",
3
+ "version": "1.14.5",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -268,7 +268,10 @@ export async function runAuthMigrations(): Promise<void> {
268
268
  let getMigrations: DbModule["getMigrations"];
269
269
  try {
270
270
  ({ getMigrations } = (await import("better-auth/db/migration")) as unknown as DbModule);
271
- } catch {
271
+ } catch (err: unknown) {
272
+ // Only fall back if the module path doesn't exist (ERR_MODULE_NOT_FOUND / ERR_PACKAGE_PATH_NOT_EXPORTED)
273
+ const code = (err as { code?: string }).code;
274
+ if (code !== "ERR_MODULE_NOT_FOUND" && code !== "ERR_PACKAGE_PATH_NOT_EXPORTED") throw err;
272
275
  ({ getMigrations } = (await import("better-auth/db")) as unknown as DbModule);
273
276
  }
274
277
  const { runMigrations } = await getMigrations(authOptions(_config));