joelburget / react-live-editor

live editing react components
163 stars 28 forks source link

This component does not compile #8

Open jeanbza opened 7 years ago

jeanbza commented 7 years ago
ERROR in ./~/babel-core/lib/api/node.js
Module not found: Error: Can't resolve 'fs' in '/Users/pivotal/workspace/pivotal-ui/styleguide_new/node_modules/babel-core/lib/api'
 @ ./~/babel-core/lib/api/node.js 58:10-23
 @ ./~/babel-core/index.js
 @ ./~/react-live-editor/live-compile.js
 @ ./~/react-live-editor/index.js
 @ ./src/app.jsx

ERROR in ./~/babel-core/lib/transformation/file/options/build-config-chain.js
Module not found: Error: Can't resolve 'fs' in '/Users/pivotal/workspace/pivotal-ui/styleguide_new/node_modules/babel-core/lib/transformation/file/options'
 @ ./~/babel-core/lib/transformation/file/options/build-config-chain.js 31:10-23
 @ ./~/babel-core/lib/transformation/file/options/option-manager.js
 @ ./~/babel-core/lib/api/node.js
 @ ./~/babel-core/index.js
 @ ./~/react-live-editor/live-compile.js
 @ ./~/react-live-editor/index.js
 @ ./src/app.jsx

ERROR in ./~/babel-core/lib/helpers/resolve.js
Module not found: Error: Can't resolve 'module' in '/Users/pivotal/workspace/pivotal-ui/styleguide_new/node_modules/babel-core/lib/helpers'
 @ ./~/babel-core/lib/helpers/resolve.js 34:14-31
 @ ./~/babel-core/lib/transformation/file/options/option-manager.js
 @ ./~/babel-core/lib/api/node.js
 @ ./~/babel-core/index.js
 @ ./~/react-live-editor/live-compile.js
 @ ./~/react-live-editor/index.js
 @ ./src/app.jsx

ERROR in ./~/convert-source-map/index.js
Module not found: Error: Can't resolve 'fs' in '/Users/pivotal/workspace/pivotal-ui/styleguide_new/node_modules/convert-source-map'
 @ ./~/convert-source-map/index.js 2:9-22
 @ ./~/babel-core/lib/transformation/file/index.js
 @ ./~/babel-core/lib/api/node.js
 @ ./~/babel-core/index.js
 @ ./~/react-live-editor/live-compile.js
 @ ./~/react-live-editor/index.js
 @ ./src/app.jsx

ERROR in ./~/debug/src/node.js
Module not found: Error: Can't resolve 'fs' in '/Users/pivotal/workspace/pivotal-ui/styleguide_new/node_modules/debug/src'
 @ ./~/debug/src/node.js 183:15-28
 @ ./~/debug/node.js
 @ ./~/babel-core/lib/transformation/file/logger.js
 @ ./~/babel-core/lib/transformation/file/index.js
 @ ./~/babel-core/lib/api/node.js
 @ ./~/babel-core/index.js
 @ ./~/react-live-editor/live-compile.js
 @ ./~/react-live-editor/index.js
 @ ./src/app.jsx
joelburget commented 7 years ago

I'll try to fix the files uploaded to npm so they don't import fs (this dependency comes from babel-core). But in the meantime you can get unstuck by adding the following to your webpack config:

  node: {
    fs: 'empty',
    net: 'empty',
    module: 'empty'
  }