Skip to content

ng serve produces truncated HTML #24707

Closed
@petercmuc

Description

@petercmuc

Which @angular/* package(s) are the source of the bug?

Don't known / other

Is this a regression?

Yes

Description

Angular devkit server fails to render big HTML pages: its contents are truncated.

In our example we have a script tag that contains static JSON data. This data is read by JS code for processing.
If the file size reaches a certain limit (probably 128kByte) the served output is not complete and we see an error when parsing the JSON data: "Uncaught SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data"

I have created a minimal repo for reproduction of that error.

Please provide a link to a minimal reproduction of the bug

https://github.com/petercmuc/angular-devkit-server-error

Please provide the exception or error you saw

"Uncaught SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data"

Please provide the environment you discovered this bug in (run ng version)

@angular-devkit/build-angular": "15.0.5"

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions