Giter VIP home page Giter VIP logo

Comments (4)

MatthewHerbst avatar MatthewHerbst commented on July 22, 2024

Hello. react-to-print doesn't interact with your build system or framework in any way. We just take whatever styles exist currently on the page. I would guess that the styles you need aren't being included properly in your production build. This is almost certainly an issue with your next.js configuration, which unfortunately isn't something I am very familiar with so I can't offer much help. It's probably a better question for StackOverflow honestly: "why are my production styles and dev styles different" etc

from react-to-print.

sammyhajomar avatar sammyhajomar commented on July 22, 2024

@MatthewHerbst but when I do allow for printing of the component using <ReactToPrint/>, the styles are all there and there is no discrepancy. So it seems to me like the html that is returned in the custom print function is different to the one that is used to print in <ReactToPrint />

from react-to-print.

MatthewHerbst avatar MatthewHerbst commented on July 22, 2024

Hmm. The same iframe that is used for the regular printing is also what's given to the print callback (code), so not sure what would be different about that.

To be clear here: the issue is that the custom print function isn't getting the right content, or is this still a dev/prod issue

from react-to-print.

siaikin avatar siaikin commented on July 22, 2024

@sammyhajomar In the first 1000 characters of the content you gave for the production environment, the styles are loaded via relative paths and no domain name is specified which may be the reason why the styles are not loaded.

from react-to-print.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.