Closed the-homeless-god closed 8 months ago
Looks like a lot of Node.js references.
Same situation for react-scripts just at the project built from scratch
Same for Next.js
It looks like the reason is tailwind
Hey @the-homeless-god, Tailwind support is server-side only so you may be encountering these issues as Tailwind parses a list of files to detect classes. However under our implementation we should be able to get going without scouting all files. I'll have a look
I face the same issue, and my web application doesn't use Tailwind. The error already appears upon import.
Hi @eliasamaral @the-homeless-god I am not able to reproduce this on my end. Would you have a sample repo or more repro steps on how you used the library so I can give a better look? Thanks!
Hi @eliasamaral @the-homeless-god I am not able to reproduce this on my end. Would you have a sample repo or more repro steps on how you used the library so I can give a better look? Thanks!
I've just created app via create-react-app, or next.js, or vite from scratch I will create a sample repo for you tomorrow, but the most important thing is:
npx create-react-app npm i react-print-pdf
and try to configure by guide and start an application. It will fail.
I would expect vite and create-react-app to fail as they are frontend only and we have an issue with tsup to bundle file system dependencies without a file system. Next should work though.
I'd be glad to take a look at the Next.js example. We use Next as our own backend and it seems to work for us as long as the docs are generated in API or pages rather than client components.
Thank you very much for your help!
Just creating a clean project in Vite, without any added dependencies, is already enough to encounter the error. Take a look at this repo: https://github.com/eliasamaral/Onedoc_issues_-5/tree/main/vite-project
Hey guys!
We dug deeper into this and because of a complex behavior of Tailwind when used with PostCSS, we can't port the Tailwind handling to the client as of now.
Given that the rest of react-print-pdf
does not rely on Tailwind and can be ported to the client, we have created a sub-import at @onedoc/react-print-pdf/client
that allows import of all client-compatible components without overlap. In the near future we will split each component to a separate bundle to prevent this from happening.
The docs have been updated to show the support for each component (i.e. https://react.onedoclabs.com/components/tailwind)
I will close this issue and create a new one for Tailwind specifically.
Thanks!
Looks like
os.platform
is not available by default