-
Notifications
You must be signed in to change notification settings - Fork 483
How is Universal going to handle UTF-8 with a BOM? #476
Comments
@gdi2290 is this just a matter of modifying the universal http? |
Tragetaschen, I'm facing this issue as well. Did you find a solution or workaround for the issue? |
I was able to just save my static assets without the BOM and didn't need to look any further. |
Hi guys. In my case the issue was caused by a dependence not imported on server. I'm using lodash to merge data (json to their class models) but, on server lodash was not explicitly imported (import * as _ from 'lodash';) in every component I want to use it. |
This is an issue with node.js. The solution on the node side is something like this: http://stackoverflow.com/posts/24376813/revisions When you make your http call, if you need to you can always split your logic using DI swapping so the node version uses a solution like this with http. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Note: for support questions, please use one of these channels: https://github.com/angular/universal/blob/master/CONTRIBUTING.md#question. This repository's issues are reserved for feature requests and bug reports.
bug
When I'm running server-side and fetching a JSON file from the server that contains UTF-8 with a BOM, Response.json() throws because node's JSON.parse doesn't accept those characters.
When running in the browser, the BOM is ignored and JSON parsing works.
Difference between running in the browser and running within node.
[all | Chrome XX | Firefox XX | IE XX | Safari XX ]none| TypeScript X.X | ES6/7 | ES5]all |NodeJs| Java | PHP | .Net | Ruby]Node itself won't change its behavior and I'm well aware that this could result in a heated argument.
For me, it was quite hard to figure out that this was the issue as the exception thrown in
facade/lang
'sJson.parse
doesn't bubble up anywhere and I only saw the annoyingWARNING: your application is taking a long time to render the application
message.The text was updated successfully, but these errors were encountered: