Skip to content

Importing module breaks build (create-react-app / webpack) #321

@sirreal

Description

@sirreal

Prerequisites

Description

import Form from 'react-jsonschema-form' breaks app.

Steps to Reproduce

  1. Initialize new project with create-react-app
  2. Install react-jsonschema-form dependency and use it in the project.
  3. Build/run app (npm start), open in browser to see error: `

Demo project available here: https://github.com/sirreal/broken-react-jsonschema-form
Relevant file: https://github.com/sirreal/broken-react-jsonschema-form/blob/master/src/App.js

The code is copied nearly verbatim from documentation:

import Form from "react-jsonschema-form";
const schema = {
  title: "Todo",
  type: "object",
  required: ["title"],
  properties: {
    title: {type: "string", title: "Title", default: "A new task"},
    done: {type: "boolean", title: "Done?", default: false}
  }
};
/* ... render() ... */
        <Form schema={schema}
          onChange={log("changed")}
          onSubmit={log("submitted")}
          onError={log("errors")}
        />
/* ... */

Expected behavior

See <Form /> component rendered

Actual behavior

App crashes with error:

browser.js:173 Uncaught Error: process.binding is not supported

Version

node --version
v6.5.0
npm --version
3.10.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions