@absolutejs/absolute 0.19.0-beta.224 → 0.19.0-beta.226

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/index.js CHANGED
@@ -217,8 +217,13 @@ var CONVENTIONS_KEY = "__absoluteConventions", getMap = () => globalThis[CONVENT
217
217
  const app = createSSRApp({
218
218
  render: () => h(ErrorComponent, errorProps)
219
219
  });
220
- const body = await renderToString(app);
221
- const html = `<!DOCTYPE html><html><head></head><body><div id="root">${body}</div></body></html>`;
220
+ let body = await renderToString(app);
221
+ let styles = "";
222
+ body = body.replace(/<style>([\s\S]*?)<\/style>/g, (_, css) => {
223
+ styles += `<style>${css.replace(/&quot;/g, '"').replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">")}</style>`;
224
+ return "";
225
+ });
226
+ const html = `<!DOCTYPE html><html><head>${styles}</head><body><div id="root">${body}</div></body></html>`;
222
227
  return new Response(html, {
223
228
  headers: { "Content-Type": "text/html" },
224
229
  status: 500
@@ -236,7 +241,12 @@ var CONVENTIONS_KEY = "__absoluteConventions", getMap = () => globalThis[CONVENT
236
241
  }
237
242
  }
238
243
  } catch (renderError) {
239
- console.error(`[SSR] Failed to render ${framework} convention error page:`, renderError);
244
+ const message = renderError instanceof Error ? renderError.message : "";
245
+ if (message.includes("Cannot find module") || message.includes("Cannot find package") || message.includes("not found in module")) {
246
+ console.error(`[SSR] Convention error page for ${framework} failed: missing framework package. Ensure the ${framework} runtime is installed (e.g. bun add ${framework === "react" ? "react react-dom" : framework}).`);
247
+ } else {
248
+ console.error(`[SSR] Failed to render ${framework} convention error page:`, renderError);
249
+ }
240
250
  }
241
251
  return null;
242
252
  }, renderConventionNotFound = async (framework) => {
@@ -276,8 +286,13 @@ var CONVENTIONS_KEY = "__absoluteConventions", getMap = () => globalThis[CONVENT
276
286
  const app = createSSRApp({
277
287
  render: () => h(NotFoundComponent)
278
288
  });
279
- const body = await renderToString(app);
280
- const html = `<!DOCTYPE html><html><head></head><body><div id="root">${body}</div></body></html>`;
289
+ let body = await renderToString(app);
290
+ let styles = "";
291
+ body = body.replace(/<style>([\s\S]*?)<\/style>/g, (_, css) => {
292
+ styles += `<style>${css.replace(/&quot;/g, '"').replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">")}</style>`;
293
+ return "";
294
+ });
295
+ const html = `<!DOCTYPE html><html><head>${styles}</head><body><div id="root">${body}</div></body></html>`;
281
296
  return new Response(html, {
282
297
  headers: { "Content-Type": "text/html" },
283
298
  status: 404
@@ -295,7 +310,12 @@ var CONVENTIONS_KEY = "__absoluteConventions", getMap = () => globalThis[CONVENT
295
310
  }
296
311
  }
297
312
  } catch (renderError) {
298
- console.error(`[SSR] Failed to render ${framework} convention not-found page:`, renderError);
313
+ const message = renderError instanceof Error ? renderError.message : "";
314
+ if (message.includes("Cannot find module") || message.includes("Cannot find package") || message.includes("not found in module")) {
315
+ console.error(`[SSR] Convention not-found page for ${framework} failed: missing framework package. Ensure the ${framework} runtime is installed (e.g. bun add ${framework === "react" ? "react react-dom" : framework}).`);
316
+ } else {
317
+ console.error(`[SSR] Failed to render ${framework} convention not-found page:`, renderError);
318
+ }
299
319
  }
300
320
  return null;
301
321
  }, NOT_FOUND_PRIORITY, renderFirstNotFound = async () => {
@@ -172378,6 +172398,10 @@ ${content.slice(firstUseIdx)}`;
172378
172398
  conventionsMap.vue = vueConventionResult.conventions;
172379
172399
  if (angularConventionResult.conventions)
172380
172400
  conventionsMap.angular = angularConventionResult.conventions;
172401
+ const notFoundFrameworks = ["react", "svelte", "vue", "angular"].filter((fw) => conventionsMap[fw]?.defaults?.notFound);
172402
+ if (notFoundFrameworks.length > 1) {
172403
+ logWarn(`Multiple frameworks define not-found convention files: ${notFoundFrameworks.join(", ")}. Only one will be used (priority: ${notFoundFrameworks[0]}). Remove not-found files from other frameworks to avoid ambiguity.`);
172404
+ }
172381
172405
  const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f) => f.includes("/html/") && (f.endsWith(".html") || f.endsWith(".css")));
172382
172406
  const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
172383
172407
  if (entry.startsWith(resolve13(reactIndexesPath))) {
@@ -178327,5 +178351,5 @@ export {
178327
178351
  ANGULAR_INIT_TIMEOUT_MS
178328
178352
  };
178329
178353
 
178330
- //# debugId=2DBD112ED081E22264756E2164756E21
178354
+ //# debugId=AA462DEA6D9AAA0164756E2164756E21
178331
178355
  //# sourceMappingURL=index.js.map