freeman-lab / control-panel

embeddable panel of inputs for parameter setting
MIT License
238 stars 17 forks source link

Control-panel in Angular app #23

Open SUlbrichA opened 6 years ago

SUlbrichA commented 6 years ago

Hi

I'm using control-panel in an angular application in a component using Three.js I get the following error on the console:

core.js:1448 ERROR TypeError: fs.readFileSync is not a function at new Plate (index.js:29) at Plate (index.js:15)

Any advice how to resolve this?

Best stefan

rreusser commented 6 years ago

I believe it requires the brfs transform (short for "browserify-fs) in order to work. If using browserify it happens automatically based on these lines in this module's package.json, but if you're using webpack, for example, you'll need something like ify-loader in order to apply them. (transform-loader always sounds tempting, but I recall that being a different sort of thing.)

If you're using webpack, here's a writeup from when I had to work through this with plotly.js and a very similar set of concerns. We did manage to get it working! I think this is the line that'll apply it, but let me know if that's not the case.

cornhundred commented 6 years ago

Thanks @rreusser. I was able to get control-panel working with webpack (same issue as #21) . Here's my package.json and webpack.config

ghost commented 6 years ago

Thanks, can confirm this solution worked for me as well!