data.json is not generated correctly
See original GitHub issue🐞 Bug report
Description
After update scully
and ng-lib
to version 1.1.1
the data.json
contains the following string:
")[1].split("
While the index.html
in state script contains the correct information and renders the page properly, navigating to the other pages in the running app breaks because it can’t get the data from the state.
🔬 Minimal Reproduction
- Have an application that utilizes
TransferStateService
. - Build the app and run scully.
- Go to dist/static/data.json
I tried it in 2 different projects and it has the same issue.
💻Your Environment
Angular Version:
Angular CLI: 11.1.4
Node: 14.16.0
OS: linux x64
Angular: 11.1.2
... animations, cdk, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1101.4
@angular-devkit/build-angular 0.1101.4
@angular-devkit/core 11.1.4
@angular-devkit/schematics 11.1.4
@angular/cli 11.1.4
@schematics/angular 11.1.4
@schematics/update 0.1101.4
rxjs 6.6.3
typescript 4.1.3
Scully Version:
"@scullyio/ng-lib": "^1.1.1",
"@scullyio/scully": "^1.1.1",
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
JSON.stringify does not generate correct json - Stack Overflow
$.ajax({ url: "SaladEntry/FillData", type: "POST", cache: false, contentType: "application/json;", data: paramSerialized, success: function ( ...
Read more >5 SQL/JSON Conditions IS JSON and IS NOT JSON
SQL/JSON conditions is json and is not json are complementary. They test whether their argument is syntactically correct, that is, well-formed, JSON data....
Read more >SyntaxError: JSON.parse: bad parsing - JavaScript | MDN
JSON.parse() parses a string as JSON. This string has to be valid JSON and will throw this error if incorrect syntax was encountered....
Read more >Solve common issues with JSON in SQL Server
Answer. If you specify the WITHOUT_ARRAY_WRAPPER option in the inner FOR JSON , the resulting JSON text is not necessarily valid JSON. Therefore ......
Read more >How to Fix “The Response Is Not a Valid JSON ... - iThemes
Wrongly configured WordPress Address and Site Address settings will interrupt the correct work of REST API, leading to “The response is not a ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@SanderElias I check the configs and what helps is switching off the
minifyJS
option off. So here is the difference it produces:minifyJS: false,
:minifyJS: true,
: and this part is exactly what gets parsed by scully, I guess you can tell why: So I am gonna turn it off for now, but I think this has to be solved by default somehow, from what I see, the version with minified inline JS is only17 bytes
smaller which I can easily let go of. I suggest we open an issue on scully-plugin-minify-html and suggest to makeminimizeJS: false
as a default, but if you have a better idea how this can be hanlded better that would interesting to know.@BlindDespair This problem is fixed already. It’s happening if you have template strings inside the JSON you’re trying to embed. I’ll check if we did release the fix tomorrow.