question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Semantic UI support

See original GitHub issue

Hello 👋

I am trying to build Semantic UI LESS distribution, but get the following error:

./src/semantic/semantic.less (./node_modules/css-loader??ref--6-oneOf-8-1!./node_modules/postcss-loader/src??postcss!./node_modules/less-loader/dist/cjs.js??ref--6-oneOf-8-3!./src/semantic/semantic.less)

module.exports = __webpack_public_path__ + "static/media/theme.9cb07199.config";
             ^
Unrecognised input
      in /Users/olessavluk/work/semantic-ui-cra/src/semantic/theme.config (line 1, column 15)

However when I try to use “clean webpack”, just with default less-loader configuration it works fine. Any idea why this might happen and how to fix it?

Repo to reproduce this issue - https://github.com/olessavluk/semantic-ui-cra

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

1reaction
therescommented, May 2, 2019

I’ve managed to make it works for me. craco.config.js:

const CracoLessPlugin= require("craco-less");
const { getLoader, loaderByName } = require("@craco/craco");
const path = require('path');

module.exports = {
  webpack: {
    configure (webpackConfig) {
      webpackConfig.resolve.alias = {
        '../../theme.config': path.join(__dirname, './src/theme.config'),
        '../../node_modules/semantic-ui-less/themes/default/elements/assets': path.resolve(__dirname, './node_modules/semantic-ui-less/themes/default/assets/')
      }

      const { isFound, match } = getLoader(webpackConfig, loaderByName("file-loader"));
      if (isFound) {
        match.loader.exclude = [...match.loader.exclude,  /\.(config|overrides|variables)$/]
      }

      return webpackConfig;
    }
  },
  plugins: [
    {
      plugin: CracoLessPlugin,
      options: {
        cssLoaderOptions: {
          modules: 'global',
          localIdentName: "[local]_[hash:base64:5]"
        }
      }
    }
  ]
};
0reactions
olessavlukcommented, May 3, 2019

Fix for this issue can be implemented by using fork with custom exclude or as @theres suggested

Read more comments on GitHub >

github_iconTop Results From Across the Web

Semantic UI
Semantic is a development framework that helps create beautiful, responsive layouts using human-friendly HTML. Concise HTML. Semantic UI treats words and ...
Read more >
Semantic-UI
Semantic is a UI framework designed for theming. ... Semantic allows developers to build beautiful websites fast, with concise HTML, intuitive javascript, and ......
Read more >
Semantic UI Guide
Semantic UI Browser Support · Last 2 Versions FF, Chrome, Safari Mac · IE 11+ · Android 4.4+, Chrome for Android 44+ ·...
Read more >
semantic-ui-css
Start using semantic-ui-css in your project by running `npm i ... There are 719 other projects in the npm registry using semantic-ui-css.
Read more >
semantic-ui - Libraries
semantic -ui ... Semantic empowers designers and developers by creating a shared vocabulary for UI. ... You can contribute on GitHub to help...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found