uiwjs / react-codemirror

CodeMirror 6 component for React. @codemirror https://uiwjs.github.io/react-codemirror/
https://uiwjs.github.io/react-codemirror/
MIT License
1.52k stars 126 forks source link

Error can‘t build #353

Open zzw827 opened 2 years ago

zzw827 commented 2 years ago

yarn build =>

./node_modules/@codemirror/lint/dist/index.js TypeError: \node_modules\@codemirror\lint\dist\index.js: Property body expected type of array but got null

just like this import React from 'react'; import CodeMirror from '@uiw/react-codemirror'; import { javascript } from '@codemirror/lang-javascript';

function App() { const onChange = React.useCallback((value, viewUpdate) => { console.log('value:', value); }, []); return ( <CodeMirror value="console.log('hello world!');" height="200px" extensions={[javascript({ jsx: true })]} onChange={onChange} /> ); } export default App;

zzw827 commented 2 years ago

"react": "^16.14.0" "react-dom": "^16.14.0", "react-scripts": "^3.4.3", "@uiw/codemirror-theme-duotone": "^4.9.4", "@uiw/react-codemirror": "^4.10.4",

jaywcjlove commented 2 years ago

@zzw827 https://codesandbox.io/embed/react-codemirror-example-codemirror-6-slvju?fontsize=14&hidenavigation=1&theme=dark

zzw827 commented 2 years ago

@zzw827 https://codesandbox.io/embed/react-codemirror-example-codemirror-6-slvju?fontsize=14&hidenavigation=1&theme=dark can i communicate with you on qq ? i did not use cra. the example is no use to me

jaywcjlove commented 2 years ago

@zzw827

You can submit your examples to the repository. I can help you troubleshoot.

mistory commented 2 years ago

npm run build =>

Failed to compile.

./node_modules/@codemirror/lint/dist/index.js
TypeError: /Users/story/my/blog/admin/node_modules/@codemirror/lint/dist/index.js: Property body expected type of array but got null

packages

"@uiw/react-codemirror": "^4.11.0",
"react-dom": "^17.0.1",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.1",
jaywcjlove commented 2 years ago

@mistory Can you provide an example?