@thexjs/core 1.2.1 → 1.2.2

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/dist/index.js +8 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1074,6 +1074,13 @@ async function buildIslandBundleInMemory(routeFilePath, layoutFilePaths, islandN
1074
1074
  assertNoEnvLeakage(code, entryPath);
1075
1075
  return wrapIslandBundle(code);
1076
1076
  } catch (err) {
1077
+ if (err instanceof EnvLeakageError) {
1078
+ console.error(
1079
+ `\x1B[1;31m\u{1F512} SECURITY: [islands] ${err.message}\x1B[0m
1080
+ Falling back to a non-interactive hydration stub \u2014 fix the env isolation (prefix with THEXJS_PUBLIC_ or move the access server-side) before relying on this page's client behavior.`
1081
+ );
1082
+ return wrapIslandBundle(generateFallbackHydration(islandNames));
1083
+ }
1077
1084
  console.warn(` [islands] build failed for ${routeFilePath}:`, err);
1078
1085
  return wrapIslandBundle(generateFallbackHydration(islandNames));
1079
1086
  } finally {
@@ -2353,6 +2360,7 @@ async function bundleRouteIslands(routeFilePath, layoutFilePaths, islandNames, i
2353
2360
  console.warn(` [islands] build error: ${log.message}`);
2354
2361
  }
2355
2362
  } catch (err) {
2363
+ if (err instanceof EnvLeakageError) throw err;
2356
2364
  console.warn(` [islands] build failed for ${routeFilePath}:`, err);
2357
2365
  }
2358
2366
  writeFileSync3(bundlePath, wrapIslandBundle(generateFallbackHydration(islandNames)), "utf-8");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thexjs/core",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "Full-stack React framework core (router, SSR/SSG renderer, islands, server functions) for the x framework, built on Bun.",
5
5
  "keywords": [
6
6
  "react",