I'm trying to add wix-style-react plugin inside my NextJS project but I'm unable to build. Inside their documentation, they say they use Stylable, SASS and CSS Modules.
When I install the plugin and build, I get the following error :
Module parse failed: Unexpected character '@' (1:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders @import '../common';
I tried both following methods :
- Using next-sass inside my
next.config.js
// next.config.js
const withSass = require('@zeit/next-sass')
module.exports = withSass({
cssModules: true
})
This way I got another error warning me about a .css file
Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders .root { | display: inline-block; | text-overflow: ellipsis;
- Using next-css in combination with next-sass
// next.config.js
const withSass = require('@zeit/next-sass')
const withCss = require('@zeit/next-css')
module.exports = withCss(
withSass({
cssModules: true,
})
)
With this config, I get again the same error as with no config. I tried to follow this in order to configure my webpack. But I have an error StylableWebpackPlugin is not a constructor
To Reproduce
- Create a new blank project with
create-next-app - Install the module
yarn add wix-style-react - Build
yarn build
System information
- OS: macOS
- Version of Next.js: 9.1.4