plotly / dash-component-boilerplate

Get started creating your own Dash components here.
265 stars 182 forks source link

Error when trying to build the components #123

Closed cthorey closed 3 years ago

cthorey commented 3 years ago

Hi, I followed the README and I manage to install all the dependencies. However, when I try to build the components with npm run build - I get an error

ERROR in ./src/lib/components/WebrtcStreamer.react.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: /workdir/src/lib/components/WebrtcStreamer.react.js: Support for the experimental syntax 'jsx' isn't currently enabled (16:13):

  14 |
  15 |         return (
> 16 |             <div id={id}>
     |             ^
  17 |                 ExampleComponent: {label}&nbsp;
  18 |                 <input
  19 |                     value={value}

Add @babel/preset-react (https://git.io/JfeDR) to the 'presets' section of your Babel config to enable transformation.
...
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! webrtc_streamer@0.0.1 build:js: `webpack --mode production`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the webrtc_streamer@0.0.1 build:js script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-04-23T10_05_11_638Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! webrtc_streamer@0.0.1 build: `npm run build:js && npm run build:backends`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the webrtc_streamer@0.0.1 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-04-23T10_05_11_652Z-debug.log

I am not that familiar with react nor node - any idea what might cause this ? Thanks for your help

cthorey commented 3 years ago

I am using npm: 6.14.12 and node v14.16.1

cthorey commented 3 years ago

nervermind - I think the problem was coming from the fact that I was trying to build it as a root user. Using a non-root user -it works.