# Troubleshoot the Svelte SDK

> Fixes for common Svelte SDK problems with manifests, preview, component mapping, and edge personalization.

Source: https://docs.uniform.app/docs/sdk/svelte/troubleshooting

> **Developer preview:**
>
> This feature is in developer preview and may change unexpectedly. For more information, contact support@uniform.dev.

## Common issues

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](https://docs.uniform.app/docs/guides/composition/visual-editing/troubleshoot-preview) 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`.
