提问前请务必仔细阅读 如何排查故障 和 常见问题。
问题描述:
通知中心打开即提示“糟糕,出错了!”,无法继续打开,但管理员权限群组不受任何影响
报错内容:
Ur {status: 500, options: {…}, xhr: XMLHttpRequest, responseText: '<br />\n<b>Deprecated</b>: json_decode(): Passing …EmitterException.php</b> on line <b>24</b><br />\n', response: null, …}
alert: {type: 'error', content: Array(1), controls: Array(1)}
options: {background: true, method: 'GET', url: 'https://www.object7053.xyz/api/notifications', params: {…}, deserialize: ƒ, …}
response: null
responseText: "<br />\n<b>Deprecated</b>: json_decode(): Passing null to parameter #1 ($json) of type string is deprecated in <b>/www/wwwroot/www.object7053.xyz/vendor/flarum/core/src/Notification/Notification.php</b> on line <b>84</b><br />\n<br />\n<b>Fatal error</b>: Uncaught Laminas\\HttpHandlerRunner\\Exception\\EmitterException: Output has been emitted previously; cannot emit response in /www/wwwroot/www.object7053.xyz/vendor/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php:24\nStack trace:\n#0 /www/wwwroot/www.object7053.xyz/vendor/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitterTrait.php(40): Laminas\\HttpHandlerRunner\\Exception\\EmitterException::forOutputSent()\n#1 /www/wwwroot/www.object7053.xyz/vendor/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitter.php(27): Laminas\\HttpHandlerRunner\\Emitter\\SapiEmitter->assertNoPreviousOutput()\n#2 /www/wwwroot/www.object7053.xyz/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(98): Laminas\\HttpHandlerRunner\\Emitter\\SapiEmitter->emit()\n#3 /www/wwwroot/www.object7053.xyz/vendor/flarum/core/src/Http/Server.php(44): Laminas\\HttpHandlerRunner\\RequestHandlerRunner->run()\n#4 /www/wwwroot/www.object7053.xyz/public/index.php(26): Flarum\\Http\\Server->listen()\n#5 {main}\n thrown in <b>/www/wwwroot/www.object7053.xyz/vendor/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php</b> on line <b>24</b><br />\n"
status: 500
xhr: XMLHttpRequest {readyState: 4, timeout: 0, withCredentials: false, abort: ƒ, onreadystatechange: ƒ, …}
[[Prototype]]: Object
调试模式报错内容:
GET https://www.object7053.xyz/api/notifications
<br />
<b>Deprecated</b>: json_decode(): Passing null to parameter #1 ($json) of type string is deprecated in <b>/www/wwwroot/www.object7053.xyz/vendor/flarum/core/src/Notification/Notification.php</b> on line <b>84</b><br />
<br />
<b>Fatal error</b>: Uncaught Laminas\HttpHandlerRunner\Exception\EmitterException: Output has been emitted previously; cannot emit response in /www/wwwroot/www.object7053.xyz/vendor/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php:24
Stack trace:
#0 /www/wwwroot/www.object7053.xyz/vendor/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitterTrait.php(40): Laminas\HttpHandlerRunner\Exception\EmitterException::forOutputSent()
#1 /www/wwwroot/www.object7053.xyz/vendor/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitter.php(27): Laminas\HttpHandlerRunner\Emitter\SapiEmitter->assertNoPreviousOutput()
#2 /www/wwwroot/www.object7053.xyz/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(98): Laminas\HttpHandlerRunner\Emitter\SapiEmitter->emit()
#3 /www/wwwroot/www.object7053.xyz/vendor/flarum/core/src/Http/Server.php(44): Laminas\HttpHandlerRunner\RequestHandlerRunner->run()
#4 /www/wwwroot/www.object7053.xyz/public/index.php(26): Flarum\Http\Server->listen()
#5 {main}
thrown in <b>/www/wwwroot/www.object7053.xyz/vendor/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php</b> on line <b>24</b><br />
已尝试的解决办法:
重置服务器,升级php,mysql