react-pdf package build errors from the Terser (NextJS 14) #81226
Unanswered
michaelNodeLondon
asked this question in
Help
Replies: 1 comment 5 replies
-
The react-pdf docs talks about, https://www.npmjs.com/package/react-pdf#nextjs: module.exports = {
swcMinify: false,
} In next.config.js, did you try with that? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I am trying to use this package react-pdf (https://www.npmjs.com/package/react-pdf) and have followed the docs to get it to work with nextjs below version 15 (I am using version 14). It works perfectly locally, however it always fails the build due to errors with the "Terser", the minifier used in nextjs.
The error I get is this: 1737.js from Terser
Unexpected token: punc ({) [1737.js:1223,10]
Seems maybe it can't compile modern Javascript syntax in the packages like ESM features maybe?
Tried downgrading the package to find one that works but that leads to it not working, or more errors.
Anybody know a solution to this error, or has got the react-pdf package working with nextjs V14?
Additional information
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions