born05 / craft-sentry

Pushes Craft CMS errors to Sentry.
MIT License
10 stars 11 forks source link

"Element query executed before Craft is fully initialized" warning when using craft-sentry #21

Closed BigglesZX closed 2 years ago

BigglesZX commented 2 years ago

Hi all. I'm getting the following warning in the logs panel of the Craft debug toolbar and I think I've narrowed it down to this plugin. When the plugin is enabled I get:

craft\elements\db\ElementQuery::prepare
Element query executed before Craft is fully initialized.

Project stack:

My config file:

<?php

return [
    '*' => [
        'enabled'        => true,
        'anonymous'      => false,
        'clientDsn'      => getenv('SENTRY_DSN'),
        'excludedCodes'  => ['400', '404', '429'],
        'release'        => getenv('SENTRY_RELEASE') ?: null,
        'reportJsErrors' => false,
        'sampleRate'     => 0,
    ],
];

Note that I've also tried 'anonymous' => true but that doesn't seem to make any difference.

Let me know if I can provide any other info. Thanks!

roelvanhintum commented 2 years ago

Thanks @BigglesZX! This is fixed in 2.0.0

BigglesZX commented 2 years ago

Thanks!