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.
Common issues#
"Cannot find module contextManifest.json"
- Run
npm run pull:manifestto download the manifest. - Ensure
UNIFORM_API_KEYandUNIFORM_PROJECT_IDare set correctly.
- Run
Preview not working
- Verify the preview URL is configured in Uniform Canvas settings.
- Check
UNIFORM_PREVIEW_SECRETmatches in both the.envfile and Uniform dashboard. - See the troubleshoot preview guide for more help.
Components not rendering
- Verify component type names in
componentMapmatch the types defined in Uniform Canvas. - Check browser console for mapping errors.
- Make sure the component is exported and imported correctly.
- Verify component type names in
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.
- Ensure you are using Svelte 5. The SDK uses Svelte 5's
Edge personalization not working
- Set
outputTypetoedgeonUniformContext. - Add the NESI hook in
src/hooks.server.tsand install@uniformdev/context-edgeand@uniformdev/context-edge-sveltekit. - The hook is
src/hooks.server.ts. Amiddleware.tsfile at the project root is ignored.
- Set
Cannot find
$env/dynamic/private- SvelteKit 3 does not provide that module. Declare variables in
src/env.tsand import them from$app/env/private.
- SvelteKit 3 does not provide that module. Declare variables in
Preview cookie is ignored
- Pass
secretto bothcreateUniformHandleandcreatePreviewHandler. - Both have to return the same
UNIFORM_PREVIEW_SECRET.
- Pass