Module not found: Can't resolve '@rjsf/core' when using simple example from documentation
See original GitHub issueDescription
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:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You should changed your documentation to use
import Form from "react-jsonschema-form"
rather thanimport Form from "@rjsf/core"
if you direct people to installnpm install react-jsonschema-form
. See this page: https://react-jsonschema-form.readthedocs.io/en/latest/#usageI 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.
Playground is in this folder: https://github.com/rjsf-team/react-jsonschema-form/tree/master/packages/playground