Next.js Discord

Discord Forum

Allow blob downloads with NextJS?

Unanswered
Nile Crocodile posted this in #help-forum
Open in Discord
Nile CrocodileOP
I've been trying to allow blob downloads with nextjs but couldn't get it working

this is my next.config.mjs
const cspHeader = `
    default-src 'self';
    script-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com/;
    object-src 'self' blob:;
`

export default {
    reactStrictMode: true,
    // ... other configurations
    async headers() {
        return [
            {
                source: '/(.*)',
                headers: [
                    {
                        key: 'Content-Security-Policy',
                        value: cspHeader.replace(/\n/g, ''),
                    },
                ],
            },
        ];
    },
};;


this is all i get and blob downloads still dont work
(node:27848) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)


if it matters i use "use client"

0 Replies