Steps to reproduce in isolation
npm create svelte@latest my-app
cd my-app
npm install
npm add @svelte/adapter-node
- Edit
svelte.config.js
- Replace auto adapter with
adapter-node
- Add
kit.csp.directives
forstyle-src
with'unsafe-inline'
- Add
kit.inlineStyleThreshold
with a value of e.g.5 * 1024
npm run build
node build
- Open the webpage (
http://localhost:3000
) in your browser - Check console for errors
Steps to reproduce in this repo
git clone https://github.com/lietu/sveltekit-csp-demo
cd sveltekit-csp-demo
npm install
npm run build
node build
- Open the webpage (
http://localhost:3000
) in your browser - Check console for errors