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

Updating to latest craft causes ArgumentCountError #1626

Closed
JMKelley opened this issue Nov 12, 2024 · 7 comments
Closed

Updating to latest craft causes ArgumentCountError #1626

JMKelley opened this issue Nov 12, 2024 · 7 comments
Assignees
Labels
issue Something isn't working correctly

Comments

@JMKelley
Copy link

What happened?

Updating Craft causes this error:
Too few arguments to function PHPStan\PhpDocParser\Lexer\Lexer::__construct(), 0 passed in /var/www/html/vendor/symfony/type-info/TypeResolver/StringTypeResolver.php on line 66 and exactly 1 expected

in /var/www/html/vendor/solspace/craft-freeform/packages/plugin/src/Bundles/Settings/DefaultsProvider.php at line 19– Symfony\Component\PropertyAccess\PropertyAccess::createPropertyAccessor()

Removing Freeform allows me to access Craft again just fine.

Errors and Stack Trace (if available)

ArgumentCountError: Too few arguments to function PHPStan\PhpDocParser\Lexer\Lexer::__construct(), 0 passed in /var/www/html/vendor/symfony/type-info/TypeResolver/StringTypeResolver.php on line 66 and exactly 1 expected in /var/www/html/vendor/phpstan/phpdoc-parser/src/Lexer/Lexer.php:102
Stack trace:
#0 /var/www/html/vendor/symfony/type-info/TypeResolver/StringTypeResolver.php(66): PHPStan\PhpDocParser\Lexer\Lexer->__construct()
#1 /var/www/html/vendor/symfony/type-info/TypeResolver/TypeResolver.php(71): Symfony\Component\TypeInfo\TypeResolver\StringTypeResolver->__construct()
#2 /var/www/html/vendor/symfony/type-info/TypeResolver/TypeResolver.php(66): Psr\Container\ContainerInterface@anonymous->__construct()
#3 /var/www/html/vendor/symfony/property-info/Extractor/ReflectionExtractor.php(102): Symfony\Component\TypeInfo\TypeResolver\TypeResolver::create()
#4 /var/www/html/vendor/symfony/property-access/PropertyAccessor.php(91): Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor->__construct(Array, NULL, NULL, false)
#5 /var/www/html/vendor/symfony/property-access/PropertyAccessorBuilder.php(289): Symfony\Component\PropertyAccess\PropertyAccessor->__construct(3, 2, NULL, NULL, NULL)
#6 /var/www/html/vendor/symfony/property-access/PropertyAccess.php(26): Symfony\Component\PropertyAccess\PropertyAccessorBuilder->getPropertyAccessor()
#7 /var/www/html/vendor/solspace/craft-freeform/packages/plugin/src/Bundles/Settings/DefaultsProvider.php(19): Symfony\Component\PropertyAccess\PropertyAccess::createPropertyAccessor()
#8 [internal function]: Solspace\Freeform\Bundles\Settings\DefaultsProvider->__construct(Object(Solspace\Freeform\Services\SettingsService))
#9 /var/www/html/vendor/yiisoft/yii2/di/Container.php(411): ReflectionClass->newInstanceArgs(Array)
#10 /var/www/html/vendor/yiisoft/yii2/di/Container.php(170): yii\di\Container->build('Solspace\\Freefo...', Array, Array)
#11 /var/www/html/vendor/yiisoft/yii2/di/Instance.php(169): yii\di\Container->get('Solspace\\Freefo...')
#12 /var/www/html/vendor/yiisoft/yii2/di/Container.php(591): yii\di\Instance->get(Object(yii\di\Container))
#13 /var/www/html/vendor/yiisoft/yii2/di/Container.php(406): yii\di\Container->resolveDependencies(Array, Object(ReflectionClass))
#14 /var/www/html/vendor/yiisoft/yii2/di/Container.php(170): yii\di\Container->build('Solspace\\Freefo...', Array, Array)
#15 /var/www/html/vendor/yiisoft/yii2/di/Instance.php(169): yii\di\Container->get('Solspace\\Freefo...')
#16 /var/www/html/vendor/yiisoft/yii2/di/Container.php(591): yii\di\Instance->get(Object(yii\di\Container))
#17 /var/www/html/vendor/yiisoft/yii2/di/Container.php(406): yii\di\Container->resolveDependencies(Array, Object(ReflectionClass))
#18 /var/www/html/vendor/yiisoft/yii2/di/Container.php(170): yii\di\Container->build('Solspace\\Freefo...', Array, Array)
#19 /var/www/html/vendor/yiisoft/yii2/BaseYii.php(345): yii\di\Container->get('Solspace\\Freefo...', Array)
#20 /var/www/html/vendor/yiisoft/yii2/di/ServiceLocator.php(137): yii\BaseYii::createObject('Solspace\\Freefo...')
#21 /var/www/html/vendor/yiisoft/yii2/base/Module.php(769): yii\di\ServiceLocator->get('forms', false)
#22 /var/www/html/vendor/yiisoft/yii2/di/ServiceLocator.php(74): yii\base\Module->get('forms')
#23 /var/www/html/vendor/solspace/craft-freeform/packages/plugin/src/Freeform.php(512): yii\di\ServiceLocator->__get('forms')
#24 /var/www/html/vendor/solspace/craft-freeform/packages/plugin/src/Freeform.php(242): Solspace\Freeform\Freeform->initEventListeners()
#25 /var/www/html/vendor/yiisoft/yii2/base/BaseObject.php(109): Solspace\Freeform\Freeform->init()
#26 /var/www/html/vendor/yiisoft/yii2/base/Module.php(161): yii\base\BaseObject->__construct(Array)
#27 /var/www/html/vendor/craftcms/cms/src/base/Plugin.php(122): yii\base\Module->__construct('freeform', Object(craft\web\Application), Array)
#28 [internal function]: craft\base\Plugin->__construct('freeform', Object(craft\web\Application), Array)
#29 /var/www/html/vendor/yiisoft/yii2/di/Container.php(419): ReflectionClass->newInstanceArgs(Array)
#30 /var/www/html/vendor/yiisoft/yii2/di/Container.php(170): yii\di\Container->build('Solspace\\Freefo...', Array, Array)
#31 /var/www/html/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get('Solspace\\Freefo...', Array, Array)
#32 /var/www/html/vendor/craftcms/cms/src/Craft.php(70): yii\BaseYii::createObject(Array, Array)
#33 /var/www/html/vendor/craftcms/cms/src/services/Plugins.php(948): Craft::createObject(Array, Array)
#34 /var/www/html/vendor/craftcms/cms/src/services/Plugins.php(233): craft\services\Plugins->createPlugin('freeform', Array)
#35 /var/www/html/vendor/craftcms/cms/src/base/ApplicationTrait.php(1631): craft\services\Plugins->loadPlugins()
#36 /var/www/html/vendor/craftcms/cms/src/web/Application.php(110): craft\web\Application->_postInit()
#37 /var/www/html/vendor/yiisoft/yii2/base/BaseObject.php(109): craft\web\Application->init()
#38 /var/www/html/vendor/yiisoft/yii2/base/Application.php(204): yii\base\BaseObject->__construct(Array)
#39 [internal function]: yii\base\Application->__construct(Array)
#40 /var/www/html/vendor/yiisoft/yii2/di/Container.php(419): ReflectionClass->newInstanceArgs(Array)
#41 /var/www/html/vendor/yiisoft/yii2/di/Container.php(170): yii\di\Container->build('craft\\web\\Appli...', Array, Array)
#42 /var/www/html/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get('craft\\web\\Appli...', Array, Array)
#43 /var/www/html/vendor/craftcms/cms/src/Craft.php(70): yii\BaseYii::createObject(Array, Array)
#44 /var/www/html/vendor/craftcms/cms/bootstrap/bootstrap.php(312): Craft::createObject(Array)
#45 /var/www/html/vendor/craftcms/cms/bootstrap/web.php(40): require('/var/www/html/v...')
#46 /var/www/html/web/index.php(13): require('/var/www/html/v...')
#47 {main}

How can we reproduce this?

  1. Install/Update to Latest Craft 5.x
  2. Update fails with (Undefined / Undefined) as the reason.
  3. Can no longer access craft.

Freeform Edition

Pro

Freeform Version

5.7.0.1

Craft Version

5.4.10.1

When did this issue start?

After upgrading from older Freeform version, After upgrading from older Craft version

Previous Freeform Version

No response

@JMKelley JMKelley added the issue Something isn't working correctly label Nov 12, 2024
@petehjfd
Copy link

I am also getting the same error when upgrading to Freeform version 5.7.0.1 with Craft 4.12.9

@lexisother
Copy link

This bug isn't related to Freeform, but is instead a bug insymfony/property-access. It has already been fixed and will be part of the package's next patch release. Unfortunately manually pinning the package to 7.0 in your project's composer.json does not fix the issue, and ^6.0 is too low of a requirement. You will have to wait for Symfony to release a new version of the package.

@kjmartens
Copy link
Contributor

Sorry about this issue, and thanks for letting us know about the issue in the symfony/property-access package @lexisother.

We are working on a workaround now and should have an update soon.

kjmartens added a commit that referenced this issue Nov 12, 2024
…around an issue in the “symfony/property-access” package
@kjmartens
Copy link
Contributor

This should be resolved in Freeform 5.7.1. Please let me know if you're still experiencing any issues. 🙂

@scholejo
Copy link

Hey @kjmartens, I'm getting this Error in v4.1.22 (with Craft 4.13.0), too. Is it possible to release a Fix for 4.x?

@kjmartens
Copy link
Contributor

Hi @scholejo,

It looks like Symfony corrected this on their end a few hours ago. Can you try running composer update again and see if it resolves the issue? 🙂

kjmartens added a commit that referenced this issue Nov 14, 2024
…ow that the issue in the “symfony/property-access” package is resolved.
@scholejo
Copy link

Hi @kjmartens, wow, I must have been just a few hours early. It works for me now. Thanks!

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

No branches or pull requests

6 participants