Skip to main content

Documentation

Documentation

Why does the build fail to download the manifest?

Check. vite build stops with an error from consentManifest that starts with the plugin's name, such as @c15t/core/build: could not fetch the consent manifest from <url> during the build. The name is @c15t/core/build for c15t/build and @c15t/vue/vite for c15t/vue/vite. vite dev logs the same message as a warning and keeps going. The part in parentheses names the cause:

MessageCauseFix
fetch failed, with ENOTFOUND, ECONNREFUSED or another network errorThe build cannot reach the backendBuild where the backend is reachable
no response within 10 secondsThe backend did not answer in timeCheck the backend, or build where it is reachable
/manifest responded 404The URL is not your project's backend, such as the https://your-project.inth.app placeholder or a URL missing its path prefixCopy the backend URL exactly as Inth shows it, or set VITE_C15T_BACKEND_URL
/manifest returned an invalid consent manifest.The URL answered with something other than a consent manifest, such as an HTML pagePoint backendURL at the backend itself, not your site or a dashboard page

A failed download never reuses an old snapshot. To deploy while the backend is down, run the build with C15T_ON_BUILD_ERROR=runtime. snapshot is then undefined, and the browser fetches the policy from the backend at runtime.

Only a build that uses manifest() downloads the manifest. The plugin fetches after Vite has dropped the code the app does not use, so a hosted() or offline() build never contacts the backend and never fails this way.

An error or warning that says no backend URL is set means the plugin found no backendURL option and no variable. Set VITE_C15T_BACKEND_URL (or VITE_INTH_PROJECT_URL) in .env or the build environment, or pass the absolute backend URL from your Inth project. The troubleshooting guide lists every message.

A notice that the build skipped the consent manifest fetch means the backend URL is relative, such as /api/c15t. Pass the absolute backend URL instead. With onBuildError: 'fail', this stops the build with build-time manifests require an absolute upstream URL.

Why is snapshot undefined?

Check. snapshot from c15t/generated is undefined, and the browser requests ${backendURL}/manifest on page load.

Fix. snapshot is undefined when Vite has no policy to serve:

  • consentManifest is missing from plugins in vite.config.ts. Without the plugin, c15t/generated still resolves, but exports undefined.
  • The fetch failed in vite dev, or in a build with C15T_ON_BUILD_ERROR=runtime. The terminal shows a could not fetch the consent manifest warning.
  • The backend URL is relative, so the plugin skipped the fetch.
  • consentManifest({ source: 'runtime' }) is set, so the plugin never fetches.

Fix the cause, then restart vite dev or rebuild. The plugin fetches once when Vite starts.