react-image-lightbox
react-image-lightbox copied to clipboard
Error: No PostCSS Config found
import 'react-image-lightbox/style.css';
For the above import code, I encountered the following errors:
ERROR in ./node_modules/react-viewer/dist/index.css (./node_modules/css-loader!./node_modules/postcss-loader/src!./node_modules/sass-loader/lib/loader.js!./node_modules/react-viewer/dist/index.css) Module build failed (from ./node_modules/postcss-loader/src/index.js): Error: No PostCSS Config found in: /Users/hmr/Documents/ngx-trunk/node_modules/react-viewer/dist at config.load.then (/Users/hmr/Documents/ngx-trunk/node_modules/postcss-load-config/src/index.js:55:15) at @ ./node_modules/react-viewer/dist/index.css 2:14-130 21:1-42:3 22:19-135 @ ./src/common/components/media/MediaViewer.js @ ./src/web/entity/EntityViewer.js @ ./src/web/entity/EntityBody.js @ ./src/web/entity/Entity.js @ ./src/web/app/routes.js @ ./src/web/app/App.js @ ./src/web/app/Root.js @ ./src/web/main.js @ ./src/web/index.js @ multi webpack-hot-middleware/client?path=http://192.168.1.101:8080/__webpack_hmr ./src/web/index.js
Who can help look at it? TIA
Make sure you have PostInstall installed via npm install postcss or if you're using Gatsby install the gatsby-plugin-postcss. Then create a config file. This is the one I made to solve an issue like yours:
$PROJECT/postcss.config.js
const postcssPresetEnv = require(`postcss-preset-env`)
module.exports = () => ({
plugins: [
postcssPresetEnv({
stage: 0,
}),
],
})