@qzsy/vinext 0.1.84 → 0.1.85

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.
@@ -19,8 +19,8 @@ import "./app-page-response.js";
19
19
  import { parseNextHttpErrorDigest } from "./next-error-digest.js";
20
20
  import { matchPrerenderRouteParamsPayload, readTrustedPrerenderRouteParams, serializePrerenderRouteParamsHeader } from "./prerender-route-params.js";
21
21
  import { getRenderedConcreteUrlPathsForRoute } from "./pregenerated-concrete-paths.js";
22
- import { flattenErrorCauses } from "../utils/error-cause.js";
23
22
  import { pickRootParams, setRootParams } from "../shims/root-params.js";
23
+ import { flattenErrorCauses } from "../utils/error-cause.js";
24
24
  import { createServerActionNotFoundResponse, getServerActionNotFoundMessage } from "./server-action-not-found.js";
25
25
  import { buildPageCacheTags } from "./implicit-tags.js";
26
26
  import { buildPostMwRequestContext } from "./app-post-middleware-context.js";
@@ -273,7 +273,7 @@ function prefetchUrl(href, mode, priority = "low") {
273
273
  cacheForNavigation: autoPrefetch.cacheForNavigation,
274
274
  optimisticRouteShell: isOptimisticRouteShellPrefetch
275
275
  });
276
- } else if (HAS_PAGES_ROUTER && window.__NEXT_DATA__) {
276
+ } else if (HAS_PAGES_ROUTER && getBrowserNextData()) {
277
277
  const dataTarget = resolvePagesDataNavigationTarget(fullHref, __basePath);
278
278
  if (dataTarget) prefetchPagesData(dataTarget);
279
279
  else {
@@ -348,6 +348,10 @@ function getSharedObserver() {
348
348
  }, { rootMargin: "250px" });
349
349
  return sharedObserver;
350
350
  }
351
+ function getBrowserNextData() {
352
+ if (typeof window === "undefined") return void 0;
353
+ return window.__NEXT_DATA__;
354
+ }
351
355
  function getDefaultLocale() {
352
356
  if (typeof window !== "undefined") return window.__VINEXT_DEFAULT_LOCALE__;
353
357
  return getI18nContext()?.defaultLocale;
@@ -361,7 +365,7 @@ function getCurrentLocale() {
361
365
  return getI18nContext()?.locale;
362
366
  }
363
367
  function getDomainLocales() {
364
- if (typeof window !== "undefined") return window.__NEXT_DATA__?.domainLocales;
368
+ if (typeof window !== "undefined") return getBrowserNextData()?.domainLocales;
365
369
  return getI18nContext()?.domainLocales;
366
370
  }
367
371
  function getCurrentHostname() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qzsy/vinext",
3
- "version": "0.1.84",
3
+ "version": "0.1.85",
4
4
  "description": "Run Next.js apps on Vite. Drop-in replacement for the next CLI.",
5
5
  "license": "MIT",
6
6
  "repository": {