Using reactstrap with Next.js











up vote
3
down vote

favorite












I am creating a React app using Next.js and am trying to use components provided by reactstrap.



The issue I seem to be running into seems to involve importing the CSS file named bootstrap/dist/css/bootstrap.min.css as the reactstrap guide says to do.



The error I am seeing is Error in bootstrap/dist/css/bootstrap.min.css
Module parse failed: Unexpected token (6:3) You may need an appropriate loader to handle this file type.



Does anyone know what I have to do to make this work correctly? I am a new web developer so sorry if I am missing anything obvious.



Thanks!










share|improve this question




























    up vote
    3
    down vote

    favorite












    I am creating a React app using Next.js and am trying to use components provided by reactstrap.



    The issue I seem to be running into seems to involve importing the CSS file named bootstrap/dist/css/bootstrap.min.css as the reactstrap guide says to do.



    The error I am seeing is Error in bootstrap/dist/css/bootstrap.min.css
    Module parse failed: Unexpected token (6:3) You may need an appropriate loader to handle this file type.



    Does anyone know what I have to do to make this work correctly? I am a new web developer so sorry if I am missing anything obvious.



    Thanks!










    share|improve this question


























      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      I am creating a React app using Next.js and am trying to use components provided by reactstrap.



      The issue I seem to be running into seems to involve importing the CSS file named bootstrap/dist/css/bootstrap.min.css as the reactstrap guide says to do.



      The error I am seeing is Error in bootstrap/dist/css/bootstrap.min.css
      Module parse failed: Unexpected token (6:3) You may need an appropriate loader to handle this file type.



      Does anyone know what I have to do to make this work correctly? I am a new web developer so sorry if I am missing anything obvious.



      Thanks!










      share|improve this question















      I am creating a React app using Next.js and am trying to use components provided by reactstrap.



      The issue I seem to be running into seems to involve importing the CSS file named bootstrap/dist/css/bootstrap.min.css as the reactstrap guide says to do.



      The error I am seeing is Error in bootstrap/dist/css/bootstrap.min.css
      Module parse failed: Unexpected token (6:3) You may need an appropriate loader to handle this file type.



      Does anyone know what I have to do to make this work correctly? I am a new web developer so sorry if I am missing anything obvious.



      Thanks!







      javascript css reactjs next.js reactstrap






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 28 at 6:47









      mtl

      4,17011217




      4,17011217










      asked Apr 24 at 2:10









      gsapienza

      285




      285
























          2 Answers
          2






          active

          oldest

          votes

















          up vote
          7
          down vote



          accepted










          EDIT: As of Next.js 7, all you have to do to support importing .css files is to register the withCSS plugin in your next.config.js. Start by installing the plugin:



          npm install --save @zeit/next-css


          Then create the next.config.js file in your project root and add the following to it:



          // next.config.js
          const withCSS = require('@zeit/next-css')
          module.exports = withCSS({/* my next config */})


          You can test that this is working by creating a simple page and importing some CSS. Start by creating a CSS file:



          // ./index.css
          div {
          color: tomato;
          }


          Then create the pages folder with an index.js file. Then you can do stuff like this in your components:



          // ./pages/index.js
          import "../index.css"
          export default () => <div>Welcome to next.js 7!</div>


          You can also use CSS modules with a few lines of config. For more on this check out the documentation on nextjs.org/docs/#css.





          Next.js < version 7



          Next.js doesn't come with CSS imports by default. You'll have to use a webpack loader. You can read about how this works here: https://zeit.co/blog/next5#css,-less,-sass,-scss-and-css-modules.



          Next.js also has plugins for CSS, SASS and SCSS. Here is the plugin for CSS: https://github.com/zeit/next-plugins/tree/master/packages/next-css. The documentation for that plugin makes it fairly simple:




          1. You create the _document file in pages/.

          2. You create the next.config.js file in the root.


          Using the code snippets from the documentation should set you up to import CSS files.



          You'll need at least version 5.0. You can make sure you have the latest Next.js installed: npm i next@latest.






          share|improve this answer



















          • 1




            Awesome that worked! Thank you very much!
            – gsapienza
            Apr 28 at 2:50






          • 1




            Thanks, the next-css solution worked well.
            – Edmundito
            Sep 27 at 17:50


















          up vote
          0
          down vote













          next-css seems like a good option. Howerver, it might not be meet your expextations.



          Fighting with the following error message and can not import css files in child components:



          TypeError: Cannot read property 'call' of undefined
          at __webpack_require__ (bootstrap:789)
          at fn (bootstrap:150)
          at Module../modules/containers/Authentication/Social/Twitter/TwitterAuth.js (VM2565 register.js:1723)
          at __webpack_require__ (bootstrap:789)
          at fn (bootstrap:150)
          at Module../modules/components/Authentication/SocialLogin/SocialLogin.js (VM2565 register.js:695)
          at __webpack_require__ (bootstrap:789)
          at fn (bootstrap:150)
          at Module../modules/components/Authentication/Register/Register.js (VM2565 register.js:661)
          at __webpack_require__ (bootstrap:789)
          at fn (bootstrap:150)
          at Module.<anonymous> (VM2565 register.js:20014)
          at Module../pages/register/index.js (VM2565 register.js:20046)
          at __webpack_require__ (bootstrap:789)
          at fn (bootstrap:150)
          at VM2565 register.js:21183
          at register (page-loader.js:124)
          at PageLoader.registerPage (page-loader.js:162)
          at Object.26 (VM2565 register.js:21182)
          at __webpack_require__ (bootstrap:789)
          at checkDeferredModules (bootstrap:45)
          at Array.webpackJsonpCallback [as push] (bootstrap:32)
          at VM2565 register.js:1


          This is the content of next.config.js :



          const withCSS = require('@zeit/next-css')
          module.exports = withCSS({
          cssModules: true,
          cssLoaderOptions: {
          importLoaders: 1,
          localIdentName: "[local]___[hash:base64:5]",
          },
          postcssLoaderOptions: {
          parser: true,
          config: {
          ctx: {
          theme: JSON.stringify(process.env.REACT_APP_THEME)
          }
          }
          },
          webpack(config, options) {
          config.optimization.namedModules = true;
          config.optimization.namedChunks = true;
          config.module.rules.push({
          test: /.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
          use: {
          loader: 'url-loader',
          options: {
          limit: 100000
          }
          }
          })
          return config
          }
          });





          share|improve this answer





















          • If you have an issue with your own code, feel free to create a new question. Don't post your question as answer on another question.
            – Dirk Scholten
            Nov 20 at 10:42










          • It's not an issue with my own code and this heading is totally relevant with what I posted here. There is an issue on next-css github repo for this item: github.com/zeit/next-plugins/issues/282. I just want to inform the people looking for a CSS solution on Next.js about this issue.
            – cemsusal
            Nov 20 at 19:32













          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f49992423%2fusing-reactstrap-with-next-js%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          7
          down vote



          accepted










          EDIT: As of Next.js 7, all you have to do to support importing .css files is to register the withCSS plugin in your next.config.js. Start by installing the plugin:



          npm install --save @zeit/next-css


          Then create the next.config.js file in your project root and add the following to it:



          // next.config.js
          const withCSS = require('@zeit/next-css')
          module.exports = withCSS({/* my next config */})


          You can test that this is working by creating a simple page and importing some CSS. Start by creating a CSS file:



          // ./index.css
          div {
          color: tomato;
          }


          Then create the pages folder with an index.js file. Then you can do stuff like this in your components:



          // ./pages/index.js
          import "../index.css"
          export default () => <div>Welcome to next.js 7!</div>


          You can also use CSS modules with a few lines of config. For more on this check out the documentation on nextjs.org/docs/#css.





          Next.js < version 7



          Next.js doesn't come with CSS imports by default. You'll have to use a webpack loader. You can read about how this works here: https://zeit.co/blog/next5#css,-less,-sass,-scss-and-css-modules.



          Next.js also has plugins for CSS, SASS and SCSS. Here is the plugin for CSS: https://github.com/zeit/next-plugins/tree/master/packages/next-css. The documentation for that plugin makes it fairly simple:




          1. You create the _document file in pages/.

          2. You create the next.config.js file in the root.


          Using the code snippets from the documentation should set you up to import CSS files.



          You'll need at least version 5.0. You can make sure you have the latest Next.js installed: npm i next@latest.






          share|improve this answer



















          • 1




            Awesome that worked! Thank you very much!
            – gsapienza
            Apr 28 at 2:50






          • 1




            Thanks, the next-css solution worked well.
            – Edmundito
            Sep 27 at 17:50















          up vote
          7
          down vote



          accepted










          EDIT: As of Next.js 7, all you have to do to support importing .css files is to register the withCSS plugin in your next.config.js. Start by installing the plugin:



          npm install --save @zeit/next-css


          Then create the next.config.js file in your project root and add the following to it:



          // next.config.js
          const withCSS = require('@zeit/next-css')
          module.exports = withCSS({/* my next config */})


          You can test that this is working by creating a simple page and importing some CSS. Start by creating a CSS file:



          // ./index.css
          div {
          color: tomato;
          }


          Then create the pages folder with an index.js file. Then you can do stuff like this in your components:



          // ./pages/index.js
          import "../index.css"
          export default () => <div>Welcome to next.js 7!</div>


          You can also use CSS modules with a few lines of config. For more on this check out the documentation on nextjs.org/docs/#css.





          Next.js < version 7



          Next.js doesn't come with CSS imports by default. You'll have to use a webpack loader. You can read about how this works here: https://zeit.co/blog/next5#css,-less,-sass,-scss-and-css-modules.



          Next.js also has plugins for CSS, SASS and SCSS. Here is the plugin for CSS: https://github.com/zeit/next-plugins/tree/master/packages/next-css. The documentation for that plugin makes it fairly simple:




          1. You create the _document file in pages/.

          2. You create the next.config.js file in the root.


          Using the code snippets from the documentation should set you up to import CSS files.



          You'll need at least version 5.0. You can make sure you have the latest Next.js installed: npm i next@latest.






          share|improve this answer



















          • 1




            Awesome that worked! Thank you very much!
            – gsapienza
            Apr 28 at 2:50






          • 1




            Thanks, the next-css solution worked well.
            – Edmundito
            Sep 27 at 17:50













          up vote
          7
          down vote



          accepted







          up vote
          7
          down vote



          accepted






          EDIT: As of Next.js 7, all you have to do to support importing .css files is to register the withCSS plugin in your next.config.js. Start by installing the plugin:



          npm install --save @zeit/next-css


          Then create the next.config.js file in your project root and add the following to it:



          // next.config.js
          const withCSS = require('@zeit/next-css')
          module.exports = withCSS({/* my next config */})


          You can test that this is working by creating a simple page and importing some CSS. Start by creating a CSS file:



          // ./index.css
          div {
          color: tomato;
          }


          Then create the pages folder with an index.js file. Then you can do stuff like this in your components:



          // ./pages/index.js
          import "../index.css"
          export default () => <div>Welcome to next.js 7!</div>


          You can also use CSS modules with a few lines of config. For more on this check out the documentation on nextjs.org/docs/#css.





          Next.js < version 7



          Next.js doesn't come with CSS imports by default. You'll have to use a webpack loader. You can read about how this works here: https://zeit.co/blog/next5#css,-less,-sass,-scss-and-css-modules.



          Next.js also has plugins for CSS, SASS and SCSS. Here is the plugin for CSS: https://github.com/zeit/next-plugins/tree/master/packages/next-css. The documentation for that plugin makes it fairly simple:




          1. You create the _document file in pages/.

          2. You create the next.config.js file in the root.


          Using the code snippets from the documentation should set you up to import CSS files.



          You'll need at least version 5.0. You can make sure you have the latest Next.js installed: npm i next@latest.






          share|improve this answer














          EDIT: As of Next.js 7, all you have to do to support importing .css files is to register the withCSS plugin in your next.config.js. Start by installing the plugin:



          npm install --save @zeit/next-css


          Then create the next.config.js file in your project root and add the following to it:



          // next.config.js
          const withCSS = require('@zeit/next-css')
          module.exports = withCSS({/* my next config */})


          You can test that this is working by creating a simple page and importing some CSS. Start by creating a CSS file:



          // ./index.css
          div {
          color: tomato;
          }


          Then create the pages folder with an index.js file. Then you can do stuff like this in your components:



          // ./pages/index.js
          import "../index.css"
          export default () => <div>Welcome to next.js 7!</div>


          You can also use CSS modules with a few lines of config. For more on this check out the documentation on nextjs.org/docs/#css.





          Next.js < version 7



          Next.js doesn't come with CSS imports by default. You'll have to use a webpack loader. You can read about how this works here: https://zeit.co/blog/next5#css,-less,-sass,-scss-and-css-modules.



          Next.js also has plugins for CSS, SASS and SCSS. Here is the plugin for CSS: https://github.com/zeit/next-plugins/tree/master/packages/next-css. The documentation for that plugin makes it fairly simple:




          1. You create the _document file in pages/.

          2. You create the next.config.js file in the root.


          Using the code snippets from the documentation should set you up to import CSS files.



          You'll need at least version 5.0. You can make sure you have the latest Next.js installed: npm i next@latest.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Sep 28 at 9:46

























          answered Apr 24 at 13:27









          mtl

          4,17011217




          4,17011217








          • 1




            Awesome that worked! Thank you very much!
            – gsapienza
            Apr 28 at 2:50






          • 1




            Thanks, the next-css solution worked well.
            – Edmundito
            Sep 27 at 17:50














          • 1




            Awesome that worked! Thank you very much!
            – gsapienza
            Apr 28 at 2:50






          • 1




            Thanks, the next-css solution worked well.
            – Edmundito
            Sep 27 at 17:50








          1




          1




          Awesome that worked! Thank you very much!
          – gsapienza
          Apr 28 at 2:50




          Awesome that worked! Thank you very much!
          – gsapienza
          Apr 28 at 2:50




          1




          1




          Thanks, the next-css solution worked well.
          – Edmundito
          Sep 27 at 17:50




          Thanks, the next-css solution worked well.
          – Edmundito
          Sep 27 at 17:50












          up vote
          0
          down vote













          next-css seems like a good option. Howerver, it might not be meet your expextations.



          Fighting with the following error message and can not import css files in child components:



          TypeError: Cannot read property 'call' of undefined
          at __webpack_require__ (bootstrap:789)
          at fn (bootstrap:150)
          at Module../modules/containers/Authentication/Social/Twitter/TwitterAuth.js (VM2565 register.js:1723)
          at __webpack_require__ (bootstrap:789)
          at fn (bootstrap:150)
          at Module../modules/components/Authentication/SocialLogin/SocialLogin.js (VM2565 register.js:695)
          at __webpack_require__ (bootstrap:789)
          at fn (bootstrap:150)
          at Module../modules/components/Authentication/Register/Register.js (VM2565 register.js:661)
          at __webpack_require__ (bootstrap:789)
          at fn (bootstrap:150)
          at Module.<anonymous> (VM2565 register.js:20014)
          at Module../pages/register/index.js (VM2565 register.js:20046)
          at __webpack_require__ (bootstrap:789)
          at fn (bootstrap:150)
          at VM2565 register.js:21183
          at register (page-loader.js:124)
          at PageLoader.registerPage (page-loader.js:162)
          at Object.26 (VM2565 register.js:21182)
          at __webpack_require__ (bootstrap:789)
          at checkDeferredModules (bootstrap:45)
          at Array.webpackJsonpCallback [as push] (bootstrap:32)
          at VM2565 register.js:1


          This is the content of next.config.js :



          const withCSS = require('@zeit/next-css')
          module.exports = withCSS({
          cssModules: true,
          cssLoaderOptions: {
          importLoaders: 1,
          localIdentName: "[local]___[hash:base64:5]",
          },
          postcssLoaderOptions: {
          parser: true,
          config: {
          ctx: {
          theme: JSON.stringify(process.env.REACT_APP_THEME)
          }
          }
          },
          webpack(config, options) {
          config.optimization.namedModules = true;
          config.optimization.namedChunks = true;
          config.module.rules.push({
          test: /.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
          use: {
          loader: 'url-loader',
          options: {
          limit: 100000
          }
          }
          })
          return config
          }
          });





          share|improve this answer





















          • If you have an issue with your own code, feel free to create a new question. Don't post your question as answer on another question.
            – Dirk Scholten
            Nov 20 at 10:42










          • It's not an issue with my own code and this heading is totally relevant with what I posted here. There is an issue on next-css github repo for this item: github.com/zeit/next-plugins/issues/282. I just want to inform the people looking for a CSS solution on Next.js about this issue.
            – cemsusal
            Nov 20 at 19:32

















          up vote
          0
          down vote













          next-css seems like a good option. Howerver, it might not be meet your expextations.



          Fighting with the following error message and can not import css files in child components:



          TypeError: Cannot read property 'call' of undefined
          at __webpack_require__ (bootstrap:789)
          at fn (bootstrap:150)
          at Module../modules/containers/Authentication/Social/Twitter/TwitterAuth.js (VM2565 register.js:1723)
          at __webpack_require__ (bootstrap:789)
          at fn (bootstrap:150)
          at Module../modules/components/Authentication/SocialLogin/SocialLogin.js (VM2565 register.js:695)
          at __webpack_require__ (bootstrap:789)
          at fn (bootstrap:150)
          at Module../modules/components/Authentication/Register/Register.js (VM2565 register.js:661)
          at __webpack_require__ (bootstrap:789)
          at fn (bootstrap:150)
          at Module.<anonymous> (VM2565 register.js:20014)
          at Module../pages/register/index.js (VM2565 register.js:20046)
          at __webpack_require__ (bootstrap:789)
          at fn (bootstrap:150)
          at VM2565 register.js:21183
          at register (page-loader.js:124)
          at PageLoader.registerPage (page-loader.js:162)
          at Object.26 (VM2565 register.js:21182)
          at __webpack_require__ (bootstrap:789)
          at checkDeferredModules (bootstrap:45)
          at Array.webpackJsonpCallback [as push] (bootstrap:32)
          at VM2565 register.js:1


          This is the content of next.config.js :



          const withCSS = require('@zeit/next-css')
          module.exports = withCSS({
          cssModules: true,
          cssLoaderOptions: {
          importLoaders: 1,
          localIdentName: "[local]___[hash:base64:5]",
          },
          postcssLoaderOptions: {
          parser: true,
          config: {
          ctx: {
          theme: JSON.stringify(process.env.REACT_APP_THEME)
          }
          }
          },
          webpack(config, options) {
          config.optimization.namedModules = true;
          config.optimization.namedChunks = true;
          config.module.rules.push({
          test: /.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
          use: {
          loader: 'url-loader',
          options: {
          limit: 100000
          }
          }
          })
          return config
          }
          });





          share|improve this answer





















          • If you have an issue with your own code, feel free to create a new question. Don't post your question as answer on another question.
            – Dirk Scholten
            Nov 20 at 10:42










          • It's not an issue with my own code and this heading is totally relevant with what I posted here. There is an issue on next-css github repo for this item: github.com/zeit/next-plugins/issues/282. I just want to inform the people looking for a CSS solution on Next.js about this issue.
            – cemsusal
            Nov 20 at 19:32















          up vote
          0
          down vote










          up vote
          0
          down vote









          next-css seems like a good option. Howerver, it might not be meet your expextations.



          Fighting with the following error message and can not import css files in child components:



          TypeError: Cannot read property 'call' of undefined
          at __webpack_require__ (bootstrap:789)
          at fn (bootstrap:150)
          at Module../modules/containers/Authentication/Social/Twitter/TwitterAuth.js (VM2565 register.js:1723)
          at __webpack_require__ (bootstrap:789)
          at fn (bootstrap:150)
          at Module../modules/components/Authentication/SocialLogin/SocialLogin.js (VM2565 register.js:695)
          at __webpack_require__ (bootstrap:789)
          at fn (bootstrap:150)
          at Module../modules/components/Authentication/Register/Register.js (VM2565 register.js:661)
          at __webpack_require__ (bootstrap:789)
          at fn (bootstrap:150)
          at Module.<anonymous> (VM2565 register.js:20014)
          at Module../pages/register/index.js (VM2565 register.js:20046)
          at __webpack_require__ (bootstrap:789)
          at fn (bootstrap:150)
          at VM2565 register.js:21183
          at register (page-loader.js:124)
          at PageLoader.registerPage (page-loader.js:162)
          at Object.26 (VM2565 register.js:21182)
          at __webpack_require__ (bootstrap:789)
          at checkDeferredModules (bootstrap:45)
          at Array.webpackJsonpCallback [as push] (bootstrap:32)
          at VM2565 register.js:1


          This is the content of next.config.js :



          const withCSS = require('@zeit/next-css')
          module.exports = withCSS({
          cssModules: true,
          cssLoaderOptions: {
          importLoaders: 1,
          localIdentName: "[local]___[hash:base64:5]",
          },
          postcssLoaderOptions: {
          parser: true,
          config: {
          ctx: {
          theme: JSON.stringify(process.env.REACT_APP_THEME)
          }
          }
          },
          webpack(config, options) {
          config.optimization.namedModules = true;
          config.optimization.namedChunks = true;
          config.module.rules.push({
          test: /.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
          use: {
          loader: 'url-loader',
          options: {
          limit: 100000
          }
          }
          })
          return config
          }
          });





          share|improve this answer












          next-css seems like a good option. Howerver, it might not be meet your expextations.



          Fighting with the following error message and can not import css files in child components:



          TypeError: Cannot read property 'call' of undefined
          at __webpack_require__ (bootstrap:789)
          at fn (bootstrap:150)
          at Module../modules/containers/Authentication/Social/Twitter/TwitterAuth.js (VM2565 register.js:1723)
          at __webpack_require__ (bootstrap:789)
          at fn (bootstrap:150)
          at Module../modules/components/Authentication/SocialLogin/SocialLogin.js (VM2565 register.js:695)
          at __webpack_require__ (bootstrap:789)
          at fn (bootstrap:150)
          at Module../modules/components/Authentication/Register/Register.js (VM2565 register.js:661)
          at __webpack_require__ (bootstrap:789)
          at fn (bootstrap:150)
          at Module.<anonymous> (VM2565 register.js:20014)
          at Module../pages/register/index.js (VM2565 register.js:20046)
          at __webpack_require__ (bootstrap:789)
          at fn (bootstrap:150)
          at VM2565 register.js:21183
          at register (page-loader.js:124)
          at PageLoader.registerPage (page-loader.js:162)
          at Object.26 (VM2565 register.js:21182)
          at __webpack_require__ (bootstrap:789)
          at checkDeferredModules (bootstrap:45)
          at Array.webpackJsonpCallback [as push] (bootstrap:32)
          at VM2565 register.js:1


          This is the content of next.config.js :



          const withCSS = require('@zeit/next-css')
          module.exports = withCSS({
          cssModules: true,
          cssLoaderOptions: {
          importLoaders: 1,
          localIdentName: "[local]___[hash:base64:5]",
          },
          postcssLoaderOptions: {
          parser: true,
          config: {
          ctx: {
          theme: JSON.stringify(process.env.REACT_APP_THEME)
          }
          }
          },
          webpack(config, options) {
          config.optimization.namedModules = true;
          config.optimization.namedChunks = true;
          config.module.rules.push({
          test: /.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
          use: {
          loader: 'url-loader',
          options: {
          limit: 100000
          }
          }
          })
          return config
          }
          });






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 20 at 10:21









          cemsusal

          11




          11












          • If you have an issue with your own code, feel free to create a new question. Don't post your question as answer on another question.
            – Dirk Scholten
            Nov 20 at 10:42










          • It's not an issue with my own code and this heading is totally relevant with what I posted here. There is an issue on next-css github repo for this item: github.com/zeit/next-plugins/issues/282. I just want to inform the people looking for a CSS solution on Next.js about this issue.
            – cemsusal
            Nov 20 at 19:32




















          • If you have an issue with your own code, feel free to create a new question. Don't post your question as answer on another question.
            – Dirk Scholten
            Nov 20 at 10:42










          • It's not an issue with my own code and this heading is totally relevant with what I posted here. There is an issue on next-css github repo for this item: github.com/zeit/next-plugins/issues/282. I just want to inform the people looking for a CSS solution on Next.js about this issue.
            – cemsusal
            Nov 20 at 19:32


















          If you have an issue with your own code, feel free to create a new question. Don't post your question as answer on another question.
          – Dirk Scholten
          Nov 20 at 10:42




          If you have an issue with your own code, feel free to create a new question. Don't post your question as answer on another question.
          – Dirk Scholten
          Nov 20 at 10:42












          It's not an issue with my own code and this heading is totally relevant with what I posted here. There is an issue on next-css github repo for this item: github.com/zeit/next-plugins/issues/282. I just want to inform the people looking for a CSS solution on Next.js about this issue.
          – cemsusal
          Nov 20 at 19:32






          It's not an issue with my own code and this heading is totally relevant with what I posted here. There is an issue on next-css github repo for this item: github.com/zeit/next-plugins/issues/282. I just want to inform the people looking for a CSS solution on Next.js about this issue.
          – cemsusal
          Nov 20 at 19:32




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f49992423%2fusing-reactstrap-with-next-js%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          404 Error Contact Form 7 ajax form submitting

          How to know if a Active Directory user can login interactively

          Refactoring coordinates for Minecraft Pi buildings written in Python