How to add Semantic UI to a Frontity projectx

Heyo so I am trying to add Semantic UI to my first Frontity project. I think I have this configured right? I get this error:

ModuleNotFoundError: Module not found: Error: Can't resolve 'lodash/fp/compact' in '/home/mpaccione/Projects/mpaccione-react/packages/mars-theme/node_modules/semantic-ui-react/dist/es/lib'
    at /home/mpaccione/Projects/mpaccione-react/node_modules/webpack/lib/Compilation.js:925:10
    at /home/mpaccione/Projects/mpaccione-react/node_modules/webpack/lib/NormalModuleFactory.js:401:22
    at /home/mpaccione/Projects/mpaccione-react/node_modules/webpack/lib/NormalModuleFactory.js:130:21
    at /home/mpaccione/Projects/mpaccione-react/node_modules/webpack/lib/NormalModuleFactory.js:224:22
    at /home/mpaccione/Projects/mpaccione-react/node_modules/neo-async/async.js:2830:7
    at /home/mpaccione/Projects/mpaccione-react/node_modules/neo-async/async.js:6877:13
    at /home/mpaccione/Projects/mpaccione-react/node_modules/webpack/lib/NormalModuleFactory.js:214:25
    at /home/mpaccione/Projects/mpaccione-react/node_modules/enhanced-resolve/lib/Resolver.js:213:14
    at /home/mpaccione/Projects/mpaccione-react/node_modules/enhanced-resolve/lib/Resolver.js:285:5
    at eval (eval at create (/home/mpaccione/Projects/mpaccione-react/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)

I believe I have correctly installed the semantic ui module in the packages package.json … I even tried installing lodash for the hell of it.

{
  "name": "@frontity/mars-theme",
  "version": "1.4.0",
  "description": "A starter theme for Frontity",
  "keywords": [
    "frontity",
    "frontity-theme"
  ],
  "homepage": "https://frontity.org",
  "license": "Apache-2.0",
  "repository": {
    "type": "git",
    "url": "https://github.com/frontity/frontity.git"
  },
  "bugs": {
    "url": "https://community.frontity.org"
  },
  "dependencies": {
    "@frontity/components": "^1.3.0",
    "@frontity/html2react": "^1.3.0",
    "frontity": "^1.5.2",
    "react-spinners": "^0.5.4",
    "semantic-ui-react": "^0.88.2",
    "lodash": "^4.17.15"
  }
}

Hi @mpaccione1991 :wave:!

Thanks for your patience! :slight_smile:

I think this is unrelated to frontity and it looks like you might still need to install lodash. Have you been able to resolve this issue?

Uh, we are actually doing a manual tree shake to lodash so I better take a look at this.

This was too much of a blocker I actually just switched to gatbsy…

Fwiw though I don’t think I did anything particularly incorrect. If you’d like I can invite you to the old repo if its helpful for you…

I have opened a bug https://github.com/frontity/frontity/issues/405

Hey, @mpaccione1991!

The issue was solved in frontity/frontity#456 and it will be included in the next release.

3 Likes