@decocms/tanstack 7.5.0 → 7.5.1

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.
Files changed (2) hide show
  1. package/package.json +4 -4
  2. package/src/vite/plugin.js +16 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/tanstack",
3
- "version": "7.5.0",
3
+ "version": "7.5.1",
4
4
  "type": "module",
5
5
  "description": "Deco framework binding for TanStack Start + Cloudflare Workers",
6
6
  "repository": {
@@ -22,9 +22,9 @@
22
22
  "lint:unused": "knip"
23
23
  },
24
24
  "dependencies": {
25
- "@decocms/blocks": "7.5.0",
26
- "@decocms/blocks-admin": "7.5.0",
27
- "@decocms/blocks-cli": "7.5.0",
25
+ "@decocms/blocks": "7.5.1",
26
+ "@decocms/blocks-admin": "7.5.1",
27
+ "@decocms/blocks-cli": "7.5.1",
28
28
  "@deco-cx/warp-node": "^0.3.16",
29
29
  "fast-json-patch": "^3.1.0",
30
30
  "ws": "^8.18.0"
@@ -224,6 +224,22 @@ export function decoVitePlugin() {
224
224
  tsImport("@decocms/blocks-cli/generate-blocks", import.meta.url),
225
225
  )
226
226
  .then((mod) => {
227
+ if (typeof mod.generateBlocks !== "function") {
228
+ // tsx 4.22.0–4.22.4 has a loader-hook state bug (fixed upstream
229
+ // in 4.22.5, "isolate hook state per async module.register()
230
+ // registration"): inside a Vite dev-server process, tsImport
231
+ // resolves correctly but returns an EMPTY module namespace —
232
+ // no rejection, no missing-module error. blocks-cli floors its
233
+ // tsx dependency at ^4.22.5, but a site's own lockfile can pin
234
+ // a broken copy that hoists above it. Fail with an actionable
235
+ // message instead of the bare "generateBlocks is not a
236
+ // function" this used to surface as.
237
+ throw new Error(
238
+ "tsImport(@decocms/blocks-cli/generate-blocks) returned an empty module namespace. " +
239
+ "This is the tsx 4.22.0–4.22.4 loader-hook bug — check `node -e \"console.log(require('tsx/package.json').version)\"` " +
240
+ "and upgrade tsx to >=4.22.5 (e.g. `bun update tsx` or pin a newer tsx in devDependencies).",
241
+ );
242
+ }
227
243
  genModule = mod;
228
244
  return mod;
229
245
  });