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

Runtime error #3

Closed
oferitz opened this issue Feb 26, 2024 · 2 comments
Closed

Runtime error #3

oferitz opened this issue Feb 26, 2024 · 2 comments

Comments

@oferitz
Copy link

oferitz commented Feb 26, 2024

Trying to use it as simple as:

const MyDocument = () => {
  return (
    <div>
      <PageTop>
        <span>Top</span>
      </PageTop>
      <div>Content</div>
      <PageBottom>
        <div className="text-gray-400 text-sm">Bottom</div>
      </PageBottom>
      <PageBreak />
      <span>New page</span>
    </div>
  )
}

const App = () => {
  return <MyDocument />
}

And getting:

@onedoc_react-print.js?v=61065e32:17695 Uncaught (in promise) TypeError: os.platform is not a function
   at node_modules/fast-glob/out/utils/path.js (@onedoc_react-print.js?v=61065e32:17695:34)
   at __require2 (chunk-WGAPYIUP.js?v=61065e32:19:50)
   at node_modules/fast-glob/out/utils/index.js (@onedoc_react-print.js?v=61065e32:20835:17)
   at __require2 (chunk-WGAPYIUP.js?v=61065e32:19:50)
   at node_modules/fast-glob/out/managers/tasks.js (@onedoc_react-print.js?v=61065e32:20850:18)
   at __require2 (chunk-WGAPYIUP.js?v=61065e32:19:50)
   at node_modules/fast-glob/out/index.js (@onedoc_react-print.js?v=61065e32:22736:23)
   at __require2 (chunk-WGAPYIUP.js?v=61065e32:19:50)
   at node_modules/tailwindcss/lib/lib/content.js (@onedoc_react-print.js?v=61065e32:22979:46)
   at __require2 (chunk-WGAPYIUP.js?v=61065e32:19:50)
   
   Version: 0.1.108
   macOS: 14.3.1
@Titou325
Copy link
Member

Hey @oferitz!

Are you trying to use the document components directly inside your app? Documents should be compiled to HTML and can then be converted by using the compile function.

I am not able to reproduce as-is, let me know if you have a sample repo at hand. You can also check out the example setup at https://github.com/OnedocLabs/dev-local

Have a nice day!

@oferitz
Copy link
Author

oferitz commented Feb 26, 2024

@Titou325, thanks. You are correct; I missed that you need to compile first. Closing.

@oferitz oferitz closed this as completed Feb 26, 2024
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

No branches or pull requests

2 participants