-
Notifications
You must be signed in to change notification settings - Fork 73
Issue-618: SSG build fails if cdnUrl is relative path #622
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
base: main
Are you sure you want to change the base?
Issue-618: SSG build fails if cdnUrl is relative path #622
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey,
Great work!
Would you be able to fix the linting? The only necessary changes are in lines 332 while others are not needed.
Apart from that, it is ready to be merged :)
Are we sure a relative cdnURL is valid? |
In our deployment it works and Nuxt also doesn't complain. It is just prepended to the path of the assets, so an actual cdn URL will work as well as local path. In the end the browser will just try to load the assets from whatever we give it and it is our duty to provide a valid path. |
Seems like linting wasn't enabled in my IDE, thanks for spotting this. I will push a fix soon 💪🏼 |
@TomHeinemeyer The official Nuxt docs require an absolute URL https://nuxt.com/docs/api/nuxt-config#cdnurl I'm not against supporting it if it works for you, however we would need to think carefully about not breaking things further down the line because the SRI hash map is defined relative to Would be really wonderful if you can include some test cases around this and also have a look at #615 to make sure both PRs do not conflict? |
I see, wasn't aware of that. I was just thinking of the deployed application. I will try to make up some test cases for that and will also have a look into the other PR 👍🏼 |
Hey @TomHeinemeyer Have you maybe looked at it? :) |
If the
cdnUrl
in the Nuxt config is not a valid url, e.g. a relative path like./
a call to the URL constructor fails because it expects a valid url. In this case just thecdnUrl
is used.