TypeError: Failed to set an indexed property [0] on 'CSSStyleDeclaration
Hi guys, I faced with this error
TypeError: Failed to set an indexed property [0] on 'CSSStyleDeclaration': Indexed property setter is not supported. at setValueForStyle (http://localhost:5173/node_modules/.vite/deps/react-dom_client.js?v=5deb1073:2145:452) at setValueForStyles (http://localhost:5173/node_modules/.vite/deps/react-dom_client.js?v=5deb1073:2192:55
My code
<Document >
<Page>
<Html>{html}</Html>
</Page>
</Document>
My HTML
const html = `<html>
Heading 1
Heading 2
Heading 3
Heading 4
Paragraph with bold, italic, underline,
strikethrough,
and all of the above
- Unordered item
- Unordered item
- Ordered item
- Ordered item
Text outside of any tags
| Column 1 | Column 2 | Column 3 |
|---|---|---|
| Foo | Bar | Foobar |
| Foo | Bar | |
| Some longer thing | Even more content than before! | Even more content than before! |
`;
Same. I usually get this error when passing an array in styles, instead of an object.
Same issue here
If you're using the first code in the README i kept deleting the elements one by one and i discovered the problem is from the <img> tag and the <a> tag when i deleted them the error disappeared but the styles are not working i get style="0:[object Object];1:[object Object]" in my inspect element in the browser
Try rendering the document inside a <PDFViewer />
I am facing Error try to resolve