dolanmiu / docx

Easily generate and modify .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.
https://docx.js.org/
MIT License
4.06k stars 463 forks source link

build failed when adding docx. import issue #2674

Open dhallX opened 2 months ago

dhallX commented 2 months ago

I saw this issue was a old issue but none of the change helped...

I have a problem with my next.is @14.0. 3 app when i install and use the package in localhost the package works! however the moment i try to build the app i get this:

image

image

I am sure this has to do with a webpack setup but i don't know what it should be so that the proper module are imported.

below is my config file

`const nextConfig = { reactStrictMode: false, // Enable React strict mode for improved error handling swcMinify: true, // Enable SWC minification for improved performance experimental: { optimizePackageImports: [ 'react-big-calendar', '@mui/lab', '@mui/x-date-pickers', 'material-react-table', 'react-calendar-timeline', 'react-hook-form', '@emotion/react', '@emotion/styled', 'aws-amplify', 'uuidv4', 'html2pdf.js', 'dayjs', ], },

images: { remotePatterns: [ ], }, };

module.exports = nextConfig;`