-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
Having an error after creating production build of a project #39
Comments
Hey @Okami92 sorry to hear that. Can you try visiting: https://kmmw7l39y7.codesandbox.io/# Does that work for you? |
@gregnb yes, this works. could you please help me with my issue? do you have any ideas how this is possible? not sure what is wrong here |
Could you paste me your package.json and also is there any chance you could share the portion of your app that does the printing into a separate repo so we could look into it? more than happy to help |
@gregnb sure, thanks a lot! I'll prepare separate repo for you in a moment
|
Great sounds good! |
@gregnb done: https://github.com/Okami92/print-error npm i, npm run build - you'll see an error. when npm run dev, it works fine. |
Ok I will try to look at this when I get some time today. Thank you |
Ok, so this issue comes from the fact that stateless components do not have refs: If you were to change your Printable component to a stateful component (ie: class Printable extends React.component) then this library will be able to attach to that ref. I will look to add a warning into the library if the component to print happens to be stateless |
Yes, it works! Thanks a lot man! I wouldn't think about it without you 👍 |
No problem! |
in dev mode, everything works fine, but when making production build, I am having this error:
http://prntscr.com/katck3
is there a reason why this can happen? I am using 2.0.0-beta-3 of react-to-print and webpack 4.6.0
The text was updated successfully, but these errors were encountered: