next-safe-middleware icon indicating copy to clipboard operation
next-safe-middleware copied to clipboard

csp-manifest.json in wrong directory

Open Cirelion opened this issue 2 years ago • 2 comments

I have a app that's running on NextJS using NX as a monorepo tool. The consequence of this is that my .next directory is in a different directory from the project root. next-safe-middleware seems to inject a directory called ~csp into the .next/static directory. This is wrong for my use-case and is the most likely reason for next-safe-middleware not working in my app.

Is there any way to override the default .next directory location?

Cirelion avatar Dec 30 '22 19:12 Cirelion

Hi @Cirelion I encountered the same issue, any luck finding a workaround?

adriancornea avatar Feb 09 '23 08:02 adriancornea

I ended up ignoring this particular part of the issue, implementing the rest of the recommended steps. I think adding gsspWithNonce() to all getServerSideProps calls that require the CSP stuff will work.

Cirelion avatar Feb 09 '23 08:02 Cirelion