Closed cgaube closed 1 year ago
@cgaube thanks for reporting this. This is happening because btoa
doesn't support unicode characters, which bootstrap seems to be using. We're looking into this and will get back to you soon.
Thanks @samarsault Looking forward to that
I did some testing around and removing the call to btoa
seem to make everything work for me.
I must be missing some context but I am not sure why this data has to be base64 for it to work
let content = data;
Are you using bootstrap with adoptedStylesheets? We use btoa
to create a serialized resource at our server for an adoptedStylesheet, and the server expects a byte data buffer.
We are using Lit to create web components and for styles they tell us to do this https://lit.dev/docs/components/styles/
I believe their css
function does use adoptedStylesheet
under the hood
https://github.com/lit/lit/blob/c10df5d71ed08e4834959fe1ed9e865f13c0e31b/packages/reactive-element/src/css-tag.ts#L11
Thank you
The problem
When trying to create the snapshot, percy and percy/storybook fail because it cannot serialize some text.
Error: DOMException: Failed to execute 'btoa' on 'Window
https://github.com/percy/cli/blob/520bd156af47080881b651e4819014cbacf76781/packages/dom/src/utils.js#LL23C35-L23C35
This is happening because im injecting some CSS in the web element shadow dom More precisely this is coming from BOOTSTRAP CSS https://github.com/twbs/bootstrap/blob/main/scss/_type.scss#L104
Environment
@percy/cli
version: 1.20.3Debug logs