Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module '@semantic-ui-react/craco-less' #4320

Closed
lynkas opened this issue Jan 19, 2022 · 3 comments
Closed

Error: Cannot find module '@semantic-ui-react/craco-less' #4320

lynkas opened this issue Jan 19, 2022 · 3 comments

Comments

@lynkas
Copy link

lynkas commented Jan 19, 2022

Steps

I'm building a semantic-ui project with theming. Following this tutorial https://react.semantic-ui.com/theming

The problem I met is, I followed all the way of its operation, and I finally got

Error: Cannot find module '@semantic-ui-react/craco-less'

error. I did install all required package, include this.

{
  "name": "sora",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.16.1",
    "@testing-library/react": "^12.1.2",
    "@testing-library/user-event": "^13.5.0",
    "@types/jest": "^27.4.0",
    "@types/node": "^16.11.21",
    "@types/react": "^17.0.38",
    "@types/react-dom": "^17.0.11",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-scripts": "5.0.0",
    "semantic-ui-react": "^2.0.4",
    "typescript": "^4.5.4",
    "web-vitals": "^2.1.3"
  },
  "scripts": {
    "start": "craco start",
    "build": "craco build",
    "test": "craco test",
    "eject": "craco eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "@craco/craco": "^6.4.3",
    "@semantic-ui-react/craco-less": "^2.0.0",
    "semantic-ui-less": "^2.4.1"
  }
}

craco.config.js

module.exports = {
    plugins: [{ plugin: require('@semantic-ui-react/craco-less') }],
}

But it still have an error when I run yarn start

yarn run v1.22.17
$ craco start
(node:7648) UnhandledPromiseRejectionWarning: Error: Cannot find module '@semantic-ui-react/craco-less'
Require stack:
- /home/cat/WebstormProjects/sora/craco.config.js
- /home/cat/WebstormProjects/sora/node_modules/cosmiconfig/dist/loaders.js
- /home/cat/WebstormProjects/sora/node_modules/cosmiconfig/dist/ExplorerBase.js
- /home/cat/WebstormProjects/sora/node_modules/cosmiconfig/dist/Explorer.js
- /home/cat/WebstormProjects/sora/node_modules/cosmiconfig/dist/index.js
- /home/cat/WebstormProjects/sora/node_modules/@craco/craco/lib/config.js
- /home/cat/WebstormProjects/sora/node_modules/@craco/craco/scripts/start.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/home/cat/WebstormProjects/sora/craco.config.js:2:25)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:14)
    at Module.require (internal/modules/cjs/loader.js:974:19)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:7648) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:7648) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Done in 0.20s.

Version

2.0.4

Well i did noticed there is a similar question #3843 but the advice there did not work either. My node version is v14.17.3. More details can be provided if required. Thank you very much.

@welcome
Copy link

welcome bot commented Jan 19, 2022

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you've completed all the fields in the issue template so we can best help.

We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@williansdejulio
Copy link

I have the exact same error. I think it's broken.

@layershifter
Copy link
Member

I just released @semantic-ui-react/craco-less@2.0.2, it works as expected.
Sorry for a broken release 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants