0

Semantic-UI-React emits debug logs: https://github.com/Semantic-Org/Semantic-UI-React/blob/master/src/modules/Modal/Modal.js#L162

But I don't see them in my browser. I'm using semantic-ui-react 0.76.0. In my local npm version of semantic-ui-react, the debug lines seem to be stripped out. Is there some debug build I need? Or maybe I need to set some webpack configuration?

Michael Gummelt
  • 702
  • 4
  • 15

1 Answers1

0

These logs are accesible only within development build of SUIR, they are striped from any npm build by babel-plugin.

You can import component directly from src with such import:

import Modal from 'semantic-ui-react/src/modules/Modal';

Your builder will build component with all non-transformed code and you will can enable it with browser console:

localStorage.debug = '*'

Also, you we will to make a page reload after this.


Don't do this with your production builds :)

Oleksandr Fediashov
  • 4,315
  • 1
  • 24
  • 42
  • I attempted this, and got the following error `./node_modules/semantic-ui-react/src/modules/Dropdown/index.js Module parse failed: Unexpected token (1:20) You may need an appropriate loader to handle this file type. | export default from './Dropdown'` . --- I also tried to follow the directions [here](https://www.npmjs.com/package/@hitchcott/semantic-ui-react#debugger) and that didn't work as well... Any suggestions? – chez.mosey Mar 25 '18 at 17:52
  • You should configure your webpack to allow load files from node_modules. – Oleksandr Fediashov Mar 26 '18 at 05:21
  • Ah, I'm using create-react-app, and I don't want to eject, so I assume making that change would require ejecting... – chez.mosey Mar 26 '18 at 09:58