Skip to content

Troubleshooting

vifu deploy blocks a remote JavaScript import

Example:

text
Rule: remote code import
URL: https://cdn.jsdelivr.net/npm/@mediapipe/[email protected]/+esm

Vifu blocks remote executable code. Bundle the dependency locally, remove the unused provider, or load it only in a local development build that is not deployed.

In Vite, Angular, or Webpack apps, search for the package or host name in source. The failing URL may come from an optional provider that is statically imported.

Use A Vifu Hub Capability

Example:

ts
fetch("https://api.openai.com/v1/chat/completions");
fetch("http://localhost:1234/v1/chat/completions");

Use the matching Vifu Hub namespace for each platform capability:

ts
await hub.ai.generateText({
  model: "basic",
  messages: [{ role: "user", content: "Give a hint." }]
});

Browser console shows CSP errors

Vifu's runtime CSP intentionally blocks:

  • CDN JavaScript
  • arbitrary connect-src endpoints
  • direct local model providers such as LM Studio
  • browser features not enabled by internal runtime policy

If CSS, fonts, images, or media are blocked, check that the URL is an approved static resource URL. If JavaScript is blocked, bundle it into the game.

hostConnected stays false

Check:

  • The game is loaded inside Vifu, not as a plain local file.
  • The Vifu Hub SDK script/import runs before Hub calls.
  • Check hub.status() after the Vifu Hub SDK bridge initializes.
  • The page did not crash before the Vifu Hub SDK bridge initialized.

Outside Vifu, hostConnected: false is normal. Your game should still boot.

A service or resource call is rejected

Declare the matching public manifest section:

Vifu Hub SDK callManifest section
hub.ai.*ai
hub.resources.readJson(...)data
hub.resources.mediaUrl(...)media
hub.resources.fileUrl(...)bundle
hub.gameState.*save
hub.dictionary.lookup(...)dictionary
hub.voice.*voice
hub.review.*review
hub.camera.capture(...)camera

Do not add services, devices, resources, permissions, or capabilities to a public game manifest.

Deploy says no changes

Vifu fingerprints the same files it uploads. If no validated build output changed, the CLI can skip upload and keep the existing game version.

If you expected a change:

  • confirm build.output points to the directory you rebuilt
  • run without --no-build
  • check that generated assets are not excluded from the upload archive

Tools do not run

  • Pass tools to hub.ai.generateText({ tools }) or hub.run(agent, input, { tools }).
  • Keep tool names stable.
  • Validate parameters / inputSchema.
  • Return JSON-compatible results from execute.