Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues when using Next.js with basePath #48

Closed
renet opened this issue Jul 15, 2022 · 3 comments · Fixed by #51
Closed

Issues when using Next.js with basePath #48

renet opened this issue Jul 15, 2022 · 3 comments · Fixed by #51
Labels
bug Something isn't working

Comments

@renet
Copy link

renet commented Jul 15, 2022

When using Next.js (18) with a basePath set in next.config.js (in our case it has a value of "/dashboard"), it seems like the script-hashes.txt and style-hashes.txt files cannot be accessed by the middleware when processing the requests. This results in errors like

TypeError: default-src 'self';object-src 'none';base-uri 'none';connect-src 'self' ws://localhost:3000/;font-src 'self';img-src 'self' data:;script-src 'unsafe-inline' <!DOCTYPE html><html><!-- full content of the 404 page --></html> 'unsafe-hashes' is not a legal HTTP header value

Using Next.js > 12.2, yarn 3.2.1 and Node 16. If you need any further information, please let me know. And thanks for a great project! :)

@nibtime
Copy link
Owner

nibtime commented Jul 23, 2022

Hi @renet

thanks for reporting this! Sorry for the little late reply, I was busy with a PR (#47) to fix stuff for Next 12.2 and other things lately. Fortunately, this one was an easy fix, it will be included in the 0.9.0 release. Also recommended for lots of other 12.2 fixes and when you host on Vercel because of #45.

@nibtime nibtime added the bug Something isn't working label Jul 24, 2022
@nibtime
Copy link
Owner

nibtime commented Jul 25, 2022

@all-contributors add @renet for bug

@allcontributors
Copy link
Contributor

@nibtime

I've put up a pull request to add @renet! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants