You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using this module in my NextJS app which downloads a pdf version of a list when the user presses a button. This package is a great fit and I'm using the <PDFDownloadLink> component in a client side parent marked with the "use client" NextJS statement.
The functionality of it works great. Pressing the button works and downloads a pdf file to the user, and there are no errors on the client side.
But there's 1 error on the server console which is "Internal error: Error: PDFDownloadLink is a web specific API. You're either using this component on Node, or your bundler is not loading react-pdf from the appropriate web build." which appears everytime the button is clicked. Not really an app breaking issue but it's just annoying to see it take up a lot of console output and I want to get rid of it.
I've tried converting the normal imports import { PDFDownloadLink } from '@react-pdf/renderer' into dynamic imports with NextJS dynamic function, so that the module is 100% loaded on the client side, but couldn't get that to work. I even tried commenting out the error in the node package code, but that gave me some strange Hydration Error from react that I don't know how to resolve.
Has anyone else come across a similar thing or knows how to hide this warning?
Thanks :)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm using this module in my NextJS app which downloads a pdf version of a list when the user presses a button. This package is a great fit and I'm using the
<PDFDownloadLink>
component in a client side parent marked with the"use client"
NextJS statement.The functionality of it works great. Pressing the button works and downloads a pdf file to the user, and there are no errors on the client side.
But there's 1 error on the server console which is
"Internal error: Error: PDFDownloadLink is a web specific API. You're either using this component on Node, or your bundler is not loading react-pdf from the appropriate web build."
which appears everytime the button is clicked. Not really an app breaking issue but it's just annoying to see it take up a lot of console output and I want to get rid of it.I've tried converting the normal imports
import { PDFDownloadLink } from '@react-pdf/renderer'
into dynamic imports with NextJSdynamic
function, so that the module is 100% loaded on the client side, but couldn't get that to work. I even tried commenting out the error in the node package code, but that gave me some strangeHydration Error
from react that I don't know how to resolve.Has anyone else come across a similar thing or knows how to hide this warning?
Thanks :)
Beta Was this translation helpful? Give feedback.
All reactions