question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Module not found: Can't resolve '@rjsf/core' when using simple example from documentation

See original GitHub issue

Description

I saw issue #1685, maybe this issue related. Trying to run simple example from the documentation, but faceoff the problem with import issue

Module not found: Can't resolve '@rjsf/core' in '../src/components/Home'

Steps to Reproduce

run npm install react-jsonschema-form --save

import React from "react";
import Form from "@rjsf/core";

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}
  }
};
const log = (type) => console.log.bind(console, type);
export default function Home() {
  return (
    <div>
      <Form schema={schema}
        onChange={log("changed")}
        onSubmit={log("submitted")}
        onError={log("errors")} />
    </div>
  );
}

Actual behavior

import issue

Module not found: Can't resolve '@rjsf/core' in '/containers/fto/src/components/Home'

Version

“react-jsonschema-form”: “^1.8.1”

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
charitygracecommented, Apr 25, 2020

You should changed your documentation to use import Form from "react-jsonschema-form" rather than import Form from "@rjsf/core" if you direct people to install npm install react-jsonschema-form. See this page: https://react-jsonschema-form.readthedocs.io/en/latest/#usage

Screen Shot 2020-04-25 at 7 18 04 PM

I just realized that the screenshot is of v2.0.0 directions but node installs v1.8.1. Not sure if you can add a clarification, but it would be helpful on the v2.0.0 docs which appear to be the default docs that come up.

1reaction
epicfaacecommented, Apr 17, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

@rjsf/core - npm
A simple React component capable of building HTML forms out of a JSON schema.. Latest version: 5.0.0-beta.15, last published: a day ago. Start...
Read more >
How to use react-jsonschema-form in react? - Stack Overflow
Module not found : Error: Can't resolve '@rjsf/core'. It turns out there are two different packages. The older package (last updated in 2019 ......
Read more >
5.x Migration - react-jsonschema-form documentation
Schema validation was decoupled from @rjsf/core to resolve issue #2693. ... RJSF is no longer actively supporting React version < 16.14.x.
Read more >
module not found: error: can't resolve '@mui/material/box'
To fix this error, you must install the package '@mui/material ' before using it. Open the terminal and run the following command to...
Read more >
Module not found | Can not resolve module in react - YouTube
Your browser can't play this video. Learn more. Switch camera.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found