Error: Cannot send header after HTTP headers have been sent (output started at C:\xampp\htdocs\nette-test-back

tomas_straka
Člen | 32
+
+1
-

Ahoj, dostavam tuhle hlasku a nevim jak jsem k ni prisel a hlavne ji neumim odstranit.
Cannot send header after HTTP headers have been sent (output started at C:\xampp\htdocs\nette-test-back\vendor\tracy\tracy\src\Tracy\Dumper\Dumper.php:158).
Co by Vam pomohlo, abych prilozil? A jak to odstranit? Diky

David Grudl
Nette Core | 8111
+
+1
-

Co je na řádku Dumper.php:158 ?

tomas_straka
Člen | 32
+
0
-

David Grudl napsal(a):

Co je na řádku Dumper.php:158 ?

/**

/**
	 * Renders <script> & <style>
	 */
	public static function renderAssets(): void
	{
		static $sent;
		if (Debugger::$productionMode === true || $sent) {
			return;
		}
		$sent = true;

		$nonce = Helpers::getNonce();
		$nonceAttr = $nonce ? ' nonce="' . Helpers::escapeHtml($nonce) . '"' : '';
		$s = file_get_contents(__DIR__ . '/../Toggle/toggle.css')
			. file_get_contents(__DIR__ . '/assets/dumper-light.css')
			. file_get_contents(__DIR__ . '/assets/dumper-dark.css');
		echo "<style{$nonceAttr}>", str_replace('</', '<\/', Helpers::minifyCss($s)), "</style>\n";

		if (!Debugger::isEnabled()) {
			$s = '(function(){' . file_get_contents(__DIR__ . '/../Toggle/toggle.js') . '})();'
				. '(function(){' . file_get_contents(__DIR__ . '/../Dumper/assets/dumper.js') . '})();';
			echo "<script{$nonceAttr}>", str_replace(['<!--', '</s'], ['<\!--', '<\/s'], Helpers::minifyJs($s)), "</script>\n";
		}
	}

Konkretne

echo "<style{$nonceAttr}>", str_replace('</', '<\/', Helpers::minifyCss($s)), "</style>\n";
tomas_straka
Člen | 32
+
+1
-

Jako jo.........hraju si se stylama-bootstrapem.

David Grudl
Nette Core | 8111
+
+2
-

Poté, co zavoláš dump(), už nemůžeš odesílat hlavičky. Hlavičky odesílá třeba i nastartování session.

tomas_straka
Člen | 32
+
+1
-

David Grudl napsal(a):

Poté, co zavoláš dump(), už nemůžeš odesílat hlavičky. Hlavičky odesílá třeba i nastartování session.

Diky, byl tam dumpe();