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

White screen with error in console: Can not convert data url with MIME type:text/plain;charset=utf8 #387

Open
Privat33r-dev opened this issue Mar 20, 2024 · 3 comments · May be fixed by #388
Assignees

Comments

@Privat33r-dev
Copy link

The error states:

Error: Can not convert data url with MIME type:text/plain;charset=utf8

I believe that it's easy to fix (e.g. by providing support for specific encodings using FileReader (since blob's text() presume UTF8). The provided MIME is RFC-2045 compatible (see section 5.1.), in fact even some examples in the RFC include charset.

@LunaticMuch
Copy link
Collaborator

Can you provide a test case for reproducing it?

@LunaticMuch LunaticMuch self-assigned this Apr 30, 2024
@Privat33r-dev
Copy link
Author

Privat33r-dev commented Apr 30, 2024

Can you provide a test case for reproducing it?

I can't provide even exact steps to reproduce it, but I sent a retrospection json to your e-mail that consistently causes the error.
Later, if I find time for this and if it's necessary, I can try to debug it to find the exact cause of the issue. Likely it's caused by some code during parsing stage.

Anyway, I provided the fix in #388, just forgot to point to this issue :)

UPD: quick search gave the root cause of the issue here

return `data:text/plain;charset=utf-8,${encodeURIComponent(str)}`;

@Privat33r-dev
Copy link
Author

Basically it starts with a warning:
Can not compress string: ReferenceError: CompressionStream is not defined

So the problem has somewhat deeper roots, but the white screen is caused by the faulty error handling (because of charset=utf8). Maybe fixing it will help with some other issues as well.

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

Successfully merging a pull request may close this issue.

2 participants