8000 Toolbar : Impossible to access an attribute ("nb_errors") on a string variable · Issue #32018 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Toolbar : Impossible to access an attribute ("nb_errors") on a string variable #32018

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

Closed
dark-matter-matters opened this issue Jun 13, 2019 · 3 comments

Comments

@dark-matter-matters
Copy link
dark-matter-matters commented Jun 13, 2019

Symfony version(s) affected: 4.3.0

Description
The web profiler tollbar is throwing an error "An error occurred while loading the web debug toolbar." on every page, when getting http://127.0.0.1:8000/_wdt/xxxxxx.

How to reproduce
I'm not sure what triggered this, but I suspect upgrading to 4.3. I use vue..js and an API.
The bundle "symfony/profiler-pack": "*" is probably up to date since I ran the dependencies update with composer.

Additional context
Google doesn't know this error!
Here's a part of the stack trace shown on http://127.0.0.1:8000/_wdt/xxxxxx :

(1/3) RuntimeErrorImpossible to access an attribute ("nb_errors") on a string variable ("O:39:"Symfony\Component\VarDumper\Cloner\Data":6:{s:45:"Symfony\Component\VarDumper\Cloner\Datadata";a:2:{i:0;a:1:{i:0;a:1:{i:1;i:1;}}i:1;a:3:{s:5:"forms";a:0:{}s:13:"forms_by_hash";a:0:{}s:9:"nb_errors";i:0;}}s:49:"Symfony\Component\VarDumper\Cloner\Dataposition";i:0;s:44:"Symfony\Component\VarDumper\Cloner\Datakey";i:0;s:49:"Symfony\Component\VarDumper\Cloner\DatamaxDepth";i:20;s:57:"Symfony\Component\VarDumper\Cloner\DatamaxItemsPerDepth";i:-1;s:54:"Symfony\Component\VarDumper\Cloner\DatauseRefHandles";i:-1;}").
--
in form.html.twig line 6
at twig_get_attribute([...]

base.html.twig :

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>{% block title %}Title{% endblock %}</title>
    {% block stylesheets %}
        {{ encore_entry_link_tags('app') }}
        <link [...]
    {% endblock %}
</head>
<body>
<div id="app">
    {% block body %}
        <div id="app" class="error">Hello</div>
    {% endblock %}
</div>

{% block javascripts %}
    {{ encore_entry_script_tags('app') }}
    <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
{% endblock %}

</body>
</html>
@linaori
Copy link
Contributor
linaori commented Jun 13, 2019

Heya, can you check if this issue is what you're experiencing? #31476

@dark-matter-matters
Copy link
Author
dark-matter-matters commented Jun 13, 2019

Thanks, it was indeed the same problem.
I solved it by changing the version of symfony/console, which used to be set to 4.2.* :

"symfony/console": "4.3.*"
 "symfony/form": "4.3.*"

@Oryss
Copy link
Oryss commented Jun 22, 2019

I have the same issue and I can't fix it

My composer.json :

    "type": "project",
    "license": "proprietary",
    "require": {
        "php": "^7.3.0",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "doctrine/annotations": "^1.6",
        "elasticsearch/elasticsearch": "6.0.1",
        "exercise/htmlpurifier-bundle": "^2.0",
        "fzaninotto/faker": "^1.8",
        "intervention/image": "^2.4",
        "knplabs/knp-paginator-bundle": "^3.0",
        "sensio/framework-extra-bundle": "^5.2",
        "symfony/asset": "4.2.*",
        "symfony/dotenv": "4.2.*",
        "symfony/filesystem": "4.2.*",
        "symfony/flex": "^1.1",
        "symfony/form": "4.2.*",
        "symfony/framework-bundle": "4.2.*",
        "symfony/orm-pack": "^1.0",
        "symfony/security-bundle": "4.2.*",
        "symfony/swiftmailer-bundle": "^3.2",
        "symfony/twig-bundle": "~4.2",
        "symfony/validator": "4.2.*",
        "symfony/webpack-encore-bundle": "^1.0",
        "symfony/yaml": "4.2.*",
        "tinymce/tinymce": "^5.0"
    },
    "config": {
        "preferred-install": {
            "*": "dist"
        },
        "sort-packages": true
    },
    "autoload": {
        "psr-4": {
            "App\\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Tests\\": "tests/"
        }
    },
    "replace": {
        "paragonie/random_compat": "2.*",
        "symfony/polyfill-ctype": "*",
        "symfony/polyfill-iconv": "*",
        "symfony/polyfill-php71": "*",
        "symfony/polyfill-php70": "*",
        "symfony/polyfill-php56": "*"
    },
    "scripts": {
        "auto-scripts": {
            "cache:clear": "symfony-cmd",
            "assets:install %PUBLIC_DIR%": "symfony-cmd"
        },
        "post-install-cmd": [
            "@auto-scripts"
        ],
        "post-update-cmd": [
            "@auto-scripts"
        ]
    },
    "conflict": {
        "symfony/symfony": "*"
    },
    "extra": {
        "symfony": {
            "allow-contrib": false,
            "require": "4.3.*"
        }
    },
    "require-dev": {
        "doctrine/doctrine-fixtures-bundle": "^3.1",
        "symfony/console": "^4.3",
        "symfony/maker-bundle": "^1.10",
        "symfony/profiler-pack": "^1.0"
    }
}

composer show :
[...]

EDIT : Nevermind, My composer.json was out of date
I've updated every package to ^4.3

I think it started working fine after I installed
"symfony/twig-bridge": "^4.3", "symfony/twig-bundle": "^4.3",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
0