From 4880a2673b13aa285f0917f7bec20eea5987d42e Mon Sep 17 00:00:00 2001 From: Colonel Jade Date: Tue, 24 Mar 2026 03:07:36 -0500 Subject: [PATCH] fix(lucide-preact): add conditional exports map for ESM/CJS resolution (#4198) Without an exports map, runtimes that follow the Node.js package resolution spec (Node.js, Bun) ignore the non-standard 'module' field and fall back to 'main' (CJS), even when the importing code is pure ESM. Since 1.0.0, the package uses useContext and useMemo from preact/hooks internally, making this a runtime-breaking issue: the CJS build loads a separate preact/hooks instance which crashes on every icon render with 'undefined is not an object'. Fixes #4196 --- packages/lucide-preact/package.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/lucide-preact/package.json b/packages/lucide-preact/package.json index 07bf592aa..083f303f5 100644 --- a/packages/lucide-preact/package.json +++ b/packages/lucide-preact/package.json @@ -25,6 +25,13 @@ "amdName": "lucide-preact", "main": "dist/cjs/lucide-preact.js", "module": "dist/esm/lucide-preact.js", + "exports": { + ".": { + "types": "./dist/lucide-preact.d.ts", + "import": "./dist/esm/lucide-preact.js", + "require": "./dist/cjs/lucide-preact.js" + } + }, "typings": "dist/lucide-preact.d.ts", "files": [ "dist"