Troubleshoot the Svelte SDK

Developer preview

This feature is in developer preview. Use with caution as it may change unexpectedly. For more information, contact us.
  1. "Cannot find module contextManifest.json"

    • Run npm run pull:manifest to download the manifest.
    • Ensure UNIFORM_API_KEY and UNIFORM_PROJECT_ID are set correctly.
  2. Preview not working

    • Verify the preview URL is configured in Uniform Canvas settings.
    • Check UNIFORM_PREVIEW_SECRET matches in both the .env file and Uniform dashboard.
    • See the troubleshoot preview guide for more help.
  3. Components not rendering

    • Verify component type names in componentMap match the types defined in Uniform Canvas.
    • Check browser console for mapping errors.
    • Make sure the component is exported and imported correctly.
  4. TypeScript errors with $props()

    • Ensure you are using Svelte 5. The SDK uses Svelte 5's $props() rune for component props.
    • Use interface Props extends ComponentProps<T> {} pattern for type-safe props.
  5. Edge personalization not working

    • Set outputType to edge on UniformContext.
    • Add the NESI hook in src/hooks.server.ts and install @uniformdev/context-edge and @uniformdev/context-edge-sveltekit.
    • The hook is src/hooks.server.ts. A middleware.ts file at the project root is ignored.
  6. Cannot find $env/dynamic/private

    • SvelteKit 3 does not provide that module. Declare variables in src/env.ts and import them from $app/env/private.
  7. Preview cookie is ignored

    • Pass secret to both createUniformHandle and createPreviewHandler.
    • Both have to return the same UNIFORM_PREVIEW_SECRET.