Skip to content

Commit

Permalink
Display original error when css fails to load (#740)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewHerbst authored Sep 28, 2024
1 parent 0f0ddd3 commit 3de1317
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/utils/handlePrintWindowOnLoad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ export function handlePrintWindowOnLoad(
messages: [
`A stylesheet could not be accessed. This is likely due to the stylesheet having cross-origin imports, and many browsers block script access to cross-origin stylesheets. See https://github.com/MatthewHerbst/react-to-print/issues/429 for details. You may be able to load the sheet by both marking the stylesheet with the cross \`crossorigin\` attribute, and setting the \`Access-Control-Allow-Origin\` header on the server serving the stylesheet. Alternatively, host the stylesheet on your domain to avoid this issue entirely.`, // eslint-disable-line max-len
node,
`Original error: ${(error as Error)?.message}`,
],
level: 'warning',
});
Expand Down

0 comments on commit 3de1317

Please sign in to comment.