Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML parser is not working anymore #108

Closed
AyaAkl25 opened this issue Sep 24, 2020 · 25 comments
Closed

HTML parser is not working anymore #108

AyaAkl25 opened this issue Sep 24, 2020 · 25 comments

Comments

@AyaAkl25
Copy link

AyaAkl25 commented Sep 24, 2020

Hey There, I don't know what happened but out of nowhere after everything was working and the html page generated was showing all the errors and logs, now whenever I try to generate with html parser the html page is generated but displays empty data then the html page just breaks and does not want to load anymore.

I tried the following approaches

xclogparser parse --file pathtologfile.xcactivitylog --reporter html
xclogparser parse --workspace pathtoworkspacefile.xcworkspace --reporter html
xclogparser parse --project mytaxi --reporter html

any clue why this might be happening?
my Xcode version is 11.5
xclogparser version: XCLogParser 0.2.18
and I am sure we are using Swift5

Thank you

@polac24
Copy link
Collaborator

polac24 commented Sep 24, 2020

Hi! You mention that html reporter is broken. Does that mean for other reporters (like --reporter flatJson), the log is parsed correctly?
Does the generated in the output directoryjs/build.js contain any log data?

@im-ling
Copy link

im-ling commented Sep 25, 2020

Hi! You mention that html reporter is broken. Does that mean for other reporters (like --reporter flatJson), the log is parsed correctly?
Does the generated in the output directoryjs/build.js contain any log data?

same problem,
--reporter flatJson seems fine,
js/build.js contains log data
20200925113843.zip

Environment:
macOS Catalina 10.15.6
Xcode Version 11.7 (11E801a)
language: swift5

@AyaAkl25
Copy link
Author

AyaAkl25 commented Sep 25, 2020

Hi! You mention that html reporter is broken. Does that mean for other reporters (like --reporter flatJson), the log is parsed correctly?
Does the generated in the output directoryjs/build.js contain any log data?

@polac24 as far as I can see from my terminal output when I try --reporter flatJson is working fine
and js/build.js contains the logs data but it is 3 GB (almost 4GB)

also I got to try the json reporter and it was working as well

@polac24
Copy link
Collaborator

polac24 commented Sep 27, 2020

3GB js/build.js is definitely too big to load in a browser. Please open the file and scan which elements are duplicated, most likely duplicated entries cause 4GB filesize.
If you can share your .xcactivitylog, that would be helpful too.

@xyreryp
Copy link

xyreryp commented Sep 28, 2020

Hi team,

I am running into the same issue.

XCLogParser 0.2.19
Xcode Version 11.5 (11E608c)
OS Version 10.15.6(19G2021)
Swift 5

Our js/build.js is 594.1 MB and contains log data. And this is what the index.html looks like
image

@xyreryp
Copy link

xyreryp commented Sep 29, 2020

So I got the fix.(kind of) @AyaAkl25 @polac24 @im-ling

I got the blank html page if I ran the command below in the xcactivitylog folder.

xclogparser parse --file {id}.xcactivitylog --reporter html --output reports/

However, if I ran the command below. It will generate the correct HTML and *.js files. And if I opened the HTML file in Chrome, it will crash. But if I open the HTML file in Safari, it will show the correct content.

 xclogparser parse --project MyApp --reporter html --output reports/

@AyaAkl25
Copy link
Author

3GB js/build.js is definitely too big to load in a browser. Please open the file and scan which elements are duplicated, most likely duplicated entries cause 4GB filesize.
If you can share your .xcactivitylog, that would be helpful too.

Unfortunately I won't be able to share the .xcactivitylog file but I am checking fir the duplicate entries.. Not sure yet why this file is starting to be that big

@AyaAkl25
Copy link
Author

So I got the fix.(kind of) @AyaAkl25 @polac24 @im-ling

I got the blank html page if I ran the command below in the xcactivitylog folder.

xclogparser parse --file {id}.xcactivitylog --reporter html --output reports/

However, if I ran the command below. It will generate the correct HTML and *.js files. And if I opened the HTML file in Chrome, it will crash. But if I open the HTML file in Safari, it will show the correct content.

 xclogparser parse --project MyApp --reporter html --output reports/

Still same issue with me even from Safari :(

@ecamacho
Copy link
Collaborator

Hi, @xyreryp @AyaAkl25 can you use Chrome to get the error? Open the html in it, right click on it and choose "Inspect" to open the developer console. Reload the page and check the Console tab for any Javascript error:

image

@AyaAkl25
Copy link
Author

Hi, @xyreryp @AyaAkl25 can you use Chrome to get the error? Open the html in it, right click on it and choose "Inspect" to open the developer console. Reload the page and check the Console tab for any Javascript error:

image

I tried that and no errors show up at all, I think the html page tries to show the data but because if the size of the log file, it cannot complete. but so far no idea why the file is so big like that. It worked before

@AyaAkl25
Copy link
Author

So I deleted all the files and everything and tried to generate the html report again, now the size is back to normal but still does not want to load any data then the page breaks

@thedavidharris
Copy link

Thisi is the error we have in console

image

@AyaAkl25
Copy link
Author

Hey guys, any help or clues on this?

@hc-almeida
Copy link

I also have the same problem.
for some reason the html works on safari, but it shows a warning that the report is taking up a lot of memory. Maybe that's why google chrome breaks.

@ecamacho
Copy link
Collaborator

@AyaAkl25 @hc-almeida can you help me check the size of the json file? It's located in the folder called js inside where the index.html is created. The name of the file is build.js
Also, do you generate Swift Type Check stats (building with the option -debug-time-expression-type-checking? We also have issues displaying the HTML when we generate them.

@AyaAkl25
Copy link
Author

@AyaAkl25 @hc-almeida can you help me check the size of the json file? It's located in the folder called js inside where the index.html is created. The name of the file is build.js
Also, do you generate Swift Type Check stats (building with the option -debug-time-expression-type-checking? We also have issues displaying the HTML when we generate them.

so the build.js file it is almost 4GB, when it is like 5,6MB everything seems fine. I tried to look for duplicated entries but so far I didn't find any.
No we don't build with -debug-time-expression-type-checking option

I have a question, like at Spotify, normally what is the size of the build.js and does it happen that sometimes this logs file gets so big?

Thank you

@ecamacho
Copy link
Collaborator

ecamacho commented Oct 21, 2020

@AyaAkl25 that's really big. I was checking ours and in the worst case it's ~145MB. Do you have too many targets or files in your project? Are you using something like Cocoapods with a lot of dependencies?

@AyaAkl25
Copy link
Author

so about targets, I tried multiple of schemes that has different numbers of targets (high and low) and same result of big size file. about Cocoapods, yes we do use it and I believe with lots of dependencies, is there a way I can solve this out?

@ecamacho
Copy link
Collaborator

I think the solution is to not use the full json for the HTML report, it's actually not needed. I will try to work on a new version that uses a smaller json with only the data we need next week

@AyaAkl25
Copy link
Author

I think the solution is to not use the full json for the HTML report, it's actually not needed. I will try to work on a new version that uses a smaller json with only the data we need next week

Thank you so much

@emesa-meli
Copy link

I think the solution is to not use the full json for the HTML report, it's actually not needed. I will try to work on a new version that uses a smaller json with only the data we need next week

Thank you. Same problem here, our json is slightly more than 3gb and we had no luck rendering the html output.

@sbanil
Copy link

sbanil commented Nov 9, 2020

I believe it appears the size of the JSON file depends on XCLog file it is parsing. So, i was able to get size from 2GB to 150MB by turning off SwiftLint and without_build_specific_information options. I was only interested in build times so this may be ok. If you want to get count of Warnings and errors may be you want to keep SwiftLink step.

@AyaAkl25
Copy link
Author

I think the solution is to not use the full json for the HTML report, it's actually not needed. I will try to work on a new version that uses a smaller json with only the data we need next week

Hey @ecamacho are there any updates on that matter? Thank you

@ecamacho
Copy link
Collaborator

Hi @AyaAkl25 @emesa-meli @hc-almeida we just released a new version that breaks down the report to smaller files so the browser can render them. Please give it a try

@chaucyzhang
Copy link

what i found is the cdn website of jquery sometimes down

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests