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

Missing manifest path causes exceptions when password strength indicator is active #34

Closed
okolvik-avento opened this issue Dec 19, 2024 · 9 comments

Comments

@okolvik-avento
Copy link

The updated plugin (from 5.0.0 and forward) is missing manifestPath for the vite component, which causes an exception when registering the indicator asset in View::EVENT_BEFORE_RENDER_PAGE_TEMPLATE.

This affects the front-end and certain parts of the backend.

Here's the full exception

ValueError: Path cannot be empty in /var/www/html/vendor/nystudio107/craft-plugin-vite/src/helpers/FileHelper.php:91
Stack trace:
#0 /var/www/html/vendor/nystudio107/craft-plugin-vite/src/helpers/FileHelper.php(91): file_get_contents('')
#1 [internal function]: nystudio107\pluginvite\helpers\FileHelper::nystudio107\pluginvite\helpers\{closure}(Object(craft\cache\FileCache))
#2 /var/www/html/vendor/yiisoft/yii2/caching/Cache.php(608): call_user_func(Object(Closure), Object(craft\cache\FileCache))
#3 /var/www/html/vendor/nystudio107/craft-plugin-vite/src/helpers/FileHelper.php(79): yii\caching\Cache->getOrSet('vite', Object(Closure), 1, Object(yii\caching\ChainedDependency))
#4 /var/www/html/vendor/nystudio107/craft-plugin-vite/src/helpers/ManifestHelper.php(53): nystudio107\pluginvite\helpers\FileHelper::fetch('', Array)
#5 /var/www/html/vendor/nystudio107/craft-plugin-vite/src/services/ViteService.php(280): nystudio107\pluginvite\helpers\ManifestHelper::fetchManifest('')
#6 /var/www/html/vendor/nystudio107/craft-plugin-vite/src/services/ViteService.php(162): nystudio107\pluginvite\services\ViteService->manifestRegister('src/js/indicato...', false, Array, Array)
#7 /var/www/html/vendor/craftpulse/craft-password-policy/src/PasswordPolicy.php(300): nystudio107\pluginvite\services\ViteService->register('src/js/indicato...', false)
#8 [internal function]: craftpulse\passwordpolicy\PasswordPolicy->craftpulse\passwordpolicy\{closure}(Object(craft\events\TemplateEvent))
#9 /var/www/html/vendor/yiisoft/yii2/base/Event.php(312): call_user_func(Object(Closure), Object(craft\events\TemplateEvent))
#10 /var/www/html/vendor/yiisoft/yii2/base/Component.php(650): yii\base\Event::trigger('craft\\web\\View', 'beforeRenderPag...', Object(craft\events\TemplateEvent))
#11 /var/www/html/vendor/craftcms/cms/src/web/View.php(2072): yii\base\Component->trigger('beforeRenderPag...', Object(craft\events\TemplateEvent))
#12 /var/www/html/vendor/craftcms/cms/src/web/View.php(582): craft\web\View->beforeRenderPageTemplate('homepage/_entry', Array, 'site')
#13 /var/www/html/vendor/craftcms/cms/src/web/TemplateResponseFormatter.php(57): craft\web\View->renderPageTemplate('homepage/_entry', Array, 'site')
#14 /var/www/html/vendor/yiisoft/yii2/web/Response.php(1109): craft\web\TemplateResponseFormatter->format(Object(craft\web\Response))
#15 /var/www/html/vendor/craftcms/cms/src/web/Response.php(341): yii\web\Response->prepare()
#16 /var/www/html/vendor/yiisoft/yii2/web/Response.php(340): craft\web\Response->prepare()
#17 /var/www/html/vendor/yiisoft/yii2/base/Application.php(390): yii\web\Response->send()
#18 /var/www/html/web/index.php(31): yii\base\Application->run()
#19 {main}
Copy link

linear bot commented Dec 19, 2024

@janhenckens
Copy link

Came here to report the same issue

@gorelegacy
Copy link

ditto

@michtio
Copy link
Contributor

michtio commented Jan 6, 2025

Thanks for the mention, and sorry for the late reply, just got back from holidays. Will look into it ASAP!

@michtio michtio changed the title Missing manifest path casues exceptions Missing manifest path causes exceptions when password strength indicator is active Jan 6, 2025
Copy link
Contributor

michtio commented Jan 7, 2025

This issue only occurs when you have the password strength indicator enabled, this won't happen without that being activated, it is a current band-aid patch as it seems that it is an issue within craft-plugin-vite I've reached out to Andrew Welsh, and will update and release ASAP.

@okolvik-avento
Copy link
Author

@michtio The strength indicator is off and i still get the exception
image

i'll continue running the beta and await the next update and test then.

@CreateSean
Copy link

I just ran into this issue after updating from Craft 4 to Craft 5.

@khalwat
Copy link
Contributor

khalwat commented Jan 7, 2025

This has been fixed in the above PR.

@michtio michtio closed this as completed in 2964017 Jan 7, 2025
@michtio michtio reopened this Jan 7, 2025
@michtio
Copy link
Contributor

michtio commented Jan 7, 2025

This has been fixed in 5.0.3 https://github.com/craftpulse/craft-password-policy/releases/tag/5.0.3

Thanks @khalwat for the support.

@michtio michtio closed this as completed Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants