Closed engram-design closed 5 months ago
I'm going to consider this a CraftCMS issue until otherwise informed -> https://github.com/craftcms/cms/issues/15043
Probably won’t fix https://github.com/nystudio107/craft-plugin-vite/pull/25/commits/13879346ffb8263354e89fb2cacf47de9a95431d but happy to wait
@engram-design you may be right... I'm just super confused on how it could never have worked on Windows... because the code is the same for Craft 3 / 4 / 5 and surely someone would have complained by now, whether users of my plugins (or yours that use it).
I'll look at your change and maybe cherry-pick it if you think it's unrelated.
Happy to wait for a resolution on https://github.com/craftcms/cms/issues/15043 before going ahead!
Looks like they fixed (one of) the issues in Craft 4.9.5 and 5.1.5 -> https://github.com/craftcms/cms/issues/15043#issuecomment-2125637951
I also pushed your normalizePath()
fix in the above commits, I just moved it further down the chain to bottleneck it.
Can you update to the latest Craft, and then try it?
Craft CMS 3:
You can try it now by setting your semver in your composer.json
to look like this:
"nystudio107/craft-plugin-vite": "dev-develop as 1.0.35”,
Then do a composer clear-cache && composer update
…..
Craft CMS 4:
You can try it now by setting your semver in your composer.json
to look like this:
"nystudio107/craft-plugin-vite": "dev-develop-v4 as 4.0.11”,
Then do a composer clear-cache && composer update
…..
Craft CMS 5:
You can try it now by setting your semver in your composer.json
to look like this:
"nystudio107/craft-plugin-vite": "dev-develop-v5 as 5.0.1”,
Then do a composer clear-cache && composer update
Looks like that Craft fix alone has done the trick! Probably not a bad idea to normalize the path, but it's not seemingly needed on my end.
Thanks!
I'm having issues with Formie (on Craft 5) where the paths are resolving incorrectly for many things, but mainly the
manifest.json
.There are two parts to this PR:
Fix path to manifest You may have to explain to me why you use
FileHelper::createUrl()
to get the path for the manifest file. It's a path, not a URL?You'll notice in Windows that the slashes are incorrect for a path, but correct if we assumed a URL, or if we assumed Linux/MacOS.
There might be other instances of
FileHelper::createUrl()
being used when dealing with paths.Fix
isAbsoluteUrl
check When it comes to fetching the manifest, you fetch it withcurl
. With the path sorted, that should be working fine, but an interesting result happens for someUrlHelper::isAbsoluteUrl($pathOrUrl)
checks in yourFileHelper
.Here, you can see we input the MacOS path and the WIndows path respectively into this function, expecting the same result - but it's not! It's treating the
C:\Users\...
as an absolute URL, which it certainly isn't. I'm surprised that Craft/Yii don't check if the string you pass into it is a URL first, but that's probably unique to your use-case here, where you allow either a path or URL.