ansu5555 / pdf-viewer-reactjs

A simple PDF viewer for React js
https://ansu5555.github.io/pdf-viewer-reactjs/
MIT License
141 stars 67 forks source link

[BUG]Build Error in Next JS - CSS import issue #59

Open prafulrajhm opened 3 years ago

prafulrajhm commented 3 years ago

Describe the bug I am using the package and my app is built on Next js. When I try to build, I am getting the below error.

`./node_modules/bulma/css/bulma.css Global CSS cannot be imported from within node_modules. Read more: https://err.sh/next.js/css-npm Location: node_modules/pdf-viewer-reactjs/dist/pdf-viewer-reactjs.js

./node_modules/bulma-helpers/css/bulma-helpers.min.css Global CSS cannot be imported from within node_modules. Read more: https://err.sh/next.js/css-npm Location: node_modules/pdf-viewer-reactjs/dist/pdf-viewer-reactjs.js

./node_modules/bulma/css/bulma.css Module build failed: Error: Final loader (./node_modules/next/dist/build/webpack/loaders/error-loader.js) didn't return a Buffer or String

./node_modules/bulma-helpers/css/bulma-helpers.min.css Module build failed: Error: Final loader (./node_modules/next/dist/build/webpack/loaders/error-loader.js) didn't return a Buffer or String

./node_modules/pdf-viewer-reactjs/dist/pdf-viewer-reactjs.js Module not found: Can't resolve 'material-design-icons/iconfont/material-icons.css' in '/home/ubuntu/frontend/node_modules/pdf-viewer-reactjs/dist' `

Details :

Additional context Solution from next js : https://github.com/vercel/next.js/blob/master/errors/css-npm.md

ansu5555 commented 3 years ago

Checking the issue, will fix fix in the next release

helight59 commented 3 years ago

same problem