tailwind-styled-v4 5.1.9 → 5.1.11

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.
package/dist/next.js CHANGED
@@ -4885,10 +4885,40 @@ ${err.message}`,
4885
4885
  });
4886
4886
  }
4887
4887
  },
4888
+ // FIX (Bug A — SSR 500 / "Cannot read properties of null (reading
4889
+ // 'useState')"): "tailwind-styled-v4" SENGAJA DIKELUARKAN dari list ini.
4890
+ //
4891
+ // Sebelumnya package utama ini ikut di-externalize bareng subpackage
4892
+ // Node-only lainnya. Akibatnya Next.js TIDAK pernah melewatkan resolusi-nya
4893
+ // lewat bundler sendiri (webpack/Turbopack) — melainkan lewat raw Node
4894
+ // require()/import() yang cuma tahu package.json "exports" conditions,
4895
+ // dan SAMA SEKALI tidak mengerti directive "use client". Di package.json
4896
+ // root, condition "react-server" dan "node" untuk "." menunjuk ke FILE
4897
+ // YANG SAMA (dist/index.mjs) — yang juga berisi implementasi hook asli
4898
+ // (createUseTokens / useBrandTokens). Begitu resolusi murni-Node ini
4899
+ // terjadi di context yang punya active condition "react-server" (RSC
4900
+ // layer-nya Next), import React di dalam file itu ikut ke-resolve ke
4901
+ // build "react-server" React sendiri (yang hook-nya sengaja di-null-kan
4902
+ // karena Server Component tidak boleh punya hook) → tokens jadi null →
4903
+ // "Cannot read properties of null (reading 'useState')".
4904
+ //
4905
+ // "tailwind-styled-v4" sebenarnya SUDAH didesain untuk dibundle normal:
4906
+ // ada dist/index.browser.mjs terpisah (exports["."].browser) yang bebas
4907
+ // Node built-ins, dan dist/index.mjs sekarang sudah benar diawali
4908
+ // directive "use client" (lihat fix preserveDirectives() di
4909
+ // tsup.config.ts). Begitu Next.js memproses file ini lewat bundler-nya
4910
+ // sendiri (bukan raw require), "use client" itu dibaca SEBAGAI directive
4911
+ // boundary asli — Next generate client reference yang benar untuk
4912
+ // Server Component, dan tetap bundle implementasi React-nya yang asli
4913
+ // untuk SSR Client Component (yang resolve "react" via condition normal,
4914
+ // BUKAN "react-server") — jadi tidak ada lagi collision.
4915
+ //
4916
+ // Subpackage Node-only lain (shared/compiler/engine/dll) TETAP di
4917
+ // externalize — mereka tidak punya varian browser sama sekali dan
4918
+ // memang tidak pernah seharusnya masuk ke client bundle.
4888
4919
  serverExternalPackages: [
4889
4920
  .../* @__PURE__ */ new Set([
4890
4921
  ...nextConfig.serverExternalPackages ?? [],
4891
- "tailwind-styled-v4",
4892
4922
  "@tailwind-styled/core",
4893
4923
  "@tailwind-styled/shared",
4894
4924
  "@tailwind-styled/compiler",