From 36ae2686205e1f71b854e3835c9751a230ff67dc Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Fri, 19 Jun 2026 11:11:08 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20resolve=20dayjs=20plugin?= =?UTF-8?q?=20ESM=20imports=20in=20data-provider=20(#13851)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `parsers.ts` imported `dayjs/plugin/utc` and `dayjs/plugin/timezone` without a file extension. The tsdown build externalizes all bare imports, so it emitted those specifiers verbatim into `dist/index.mjs`. dayjs@1.11 ships no `exports` map, so under strict Node ESM the extensionless subpaths fail with ERR_MODULE_NOT_FOUND ("Did you mean to import 'dayjs/plugin/utc.js'?"), breaking every strict-ESM consumer that transitively imports data-provider (and data-schemas, which re-exports it) — e.g. vitest suites in downstream apps. Add the `.js` extension so the externalized imports resolve. With moduleResolution: bundler the types still resolve from the plugin `.d.ts`. Bump to 0.8.507 to supersede the broken 0.8.506 publish. Verified: build clean, `dist/index.mjs` imports under strict Node ESM (node --input-type=module), parsers specs 50/50. --- packages/data-provider/package.json | 2 +- packages/data-provider/src/parsers.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/data-provider/package.json b/packages/data-provider/package.json index fa305e9c6c..bec6936c94 100644 --- a/packages/data-provider/package.json +++ b/packages/data-provider/package.json @@ -1,6 +1,6 @@ { "name": "librechat-data-provider", - "version": "0.8.506", + "version": "0.8.507", "description": "data services for librechat apps", "main": "dist/index.js", "module": "dist/index.mjs", diff --git a/packages/data-provider/src/parsers.ts b/packages/data-provider/src/parsers.ts index d34d068cbc..c30297f581 100644 --- a/packages/data-provider/src/parsers.ts +++ b/packages/data-provider/src/parsers.ts @@ -1,6 +1,6 @@ import dayjs from 'dayjs'; -import utc from 'dayjs/plugin/utc'; -import timezonePlugin from 'dayjs/plugin/timezone'; +import utc from 'dayjs/plugin/utc.js'; +import timezonePlugin from 'dayjs/plugin/timezone.js'; import type { ZodIssue } from 'zod'; import type * as a from './types/assistants'; import type * as s from './schemas';