Open 1846689910 opened 4 years ago
after loading the react-bootstrap, the carousel cannot load.
Reason: the react-bootstrap cannot work with css-modules, but our next.config.js set cssModules:true, so
react-bootstrap
css-modules
next.config.js
cssModules:true
import "bootstrap/dist/css/bootstrap.min.css";
will become transpiled css className.
workaround: to exclude the bootstrap.min.css from the next-css css modules conversion by adding:
bootstrap.min.css
next-css
cssModules: true, cssLoaderOptions: { importLoaders: 1, localIdentName: `${ enableShortHash ? "" : "[name]__[local]___" }"[hash:base64:5]"`, getLocalIdent(loaderContext, localIdentName, localName, options){ return loaderContext.resourcePath.includes("bootstrap.min.css") ? localName : localIdentName; }, },
needs to be recorded to type-18-next
solution: https://github.com/vercel/next.js/discussions/14946#discussioncomment-34888
after loading the react-bootstrap, the carousel cannot load.
Reason: the
react-bootstrap
cannot work withcss-modules
, but ournext.config.js
setcssModules:true
, sowill become transpiled css className.
workaround: to exclude the
bootstrap.min.css
from thenext-css
css modules conversion by adding: