You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The craft.vite.inline() function doesn't output the contents of my CSS file when the serverPublic setting in the config uses only a relative local path and doesn't include the base URL.
craft.vite.entry('src/scss/critical.scss') outputs the correct URL in both scenarios, so it's just the inline() function that doesn't seem to be working in the latter.
There is an error output to the web log, but it's the same in both scenarios as well:
2023-01-13 16:43:03 [web.ERROR] [nystudio107\pluginvite\helpers\FileHelper::fetchResponse] cURL error 7: Failed to connect to localhost port 5173 after 1274 ms: Couldn't connect to server (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://localhost:5173/__vite_ping {"memory":1923336}
Not a critical issue, but we would prefer to use relative paths for these resources.
Versions
Plugin version: 4.0.4
Craft version: 4.3.6.1
The text was updated successfully, but these errors were encountered:
I looked into this, but I wasn't quite sure how to build this in while ensuring backwards compatibility. I did track it down to this file in craft-plugin-vite. The URL is web-relative and not server-relative so I was able to fix it in my case by prefixing it with @webroot:
The
craft.vite.inline()
function doesn't output the contents of my CSS file when theserverPublic
setting in the config uses only a relative local path and doesn't include the base URL.Essentially, this line:
works ONLY when
but NOT when
craft.vite.entry('src/scss/critical.scss')
outputs the correct URL in both scenarios, so it's just theinline()
function that doesn't seem to be working in the latter.There is an error output to the web log, but it's the same in both scenarios as well:
Not a critical issue, but we would prefer to use relative paths for these resources.
Versions
The text was updated successfully, but these errors were encountered: