Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error - TypeError: Cannot redefine property: EditorView #304

Closed
mbui0327 opened this issue Apr 24, 2022 · 6 comments
Closed

error - TypeError: Cannot redefine property: EditorView #304

mbui0327 opened this issue Apr 24, 2022 · 6 comments

Comments

@mbui0327
Copy link

mbui0327 commented Apr 24, 2022

Hi all, I run into this issue after doing npm i with version 4.7.0. It works fine with 4.6.0 Thanks.

error - TypeError: Cannot redefine property: EditorView
    at Function.defineProperty (<anonymous>)
    at ../node_modules/@uiw/react-codemirror/cjs/index.js:57:10
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/Users/bachbui/works/cycai/tmp/cyc-next/cyc-next-app/node_modules/@uiw/react-codemirror/cjs/index.js:53:26)
    at Module._compile (node:internal/modules/cjs/loader:1099:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:102:18) {
  page: '/'
}
@jaywcjlove
Copy link
Member

@mbui0327

Please provide a reproduction example via codesandbox.io.

@eeve
Copy link

eeve commented Apr 26, 2022

类似的错误

ERROR in ./node_modules/@uiw/react-codemirror/esm/index.js 8:0-40
The requested module '@codemirror/basic-setup' contains conflicting star exports for the name 'EditorView' with the previous requested module '@codemirror/view'
 @ ./node_modules/xx/dist/esm/index.js 12:0-47 1182:18-28
 @ ./src/pages/xx/List.tsx 8:0-39 38:6-15 230:10-19
 @ ./src/pages/ lazy ^\.\/.*$ namespace object ./xx/List.tsx ./xx/List
 @ ./src/index.tsx 10:22-47

ERROR in ./node_modules/@uiw/react-codemirror/esm/index.js 9:0-34
The requested module '@codemirror/state' contains conflicting star exports for the name 'EditorState' with the previous requested module '@codemirror/basic-setup'
 @ ./node_modules/xx/dist/esm/index.js 12:0-47 1182:18-28
 @ ./src/pages/xx/List.tsx 8:0-39 38:6-15 230:10-19
 @ ./src/pages/ lazy ^\.\/.*$ namespace object ./xx/List.tsx ./xx/List
 @ ./src/index.tsx 10:22-47

原因也是 版本从4.6.0到4.7.0升级导致的。

@jaywcjlove
Copy link
Member

@eeve 删除 node_modulespackage-lock.json 文件重新安装。

@jaywcjlove
Copy link
Member

npm ls @codemirror/basic-setup
@uiw/[email protected] /react-codemirror
└── @codemirror/[email protected]
npm ls @codemirror/state
@uiw/[email protected] /react-codemirror
├─┬ @codemirror/[email protected]
│ ├─┬ @codemirror/[email protected]
│ │ └── @codemirror/[email protected] deduped
│ ├─┬ @codemirror/[email protected]
│ │ └── @codemirror/[email protected] deduped
│ ├─┬ @codemirror/[email protected]
│ │ └── @codemirror/[email protected] deduped
│ ├─┬ @codemirror/[email protected]
│ │ └── @codemirror/[email protected] deduped
│ ├─┬ @codemirror/[email protected]
│ │ └── @codemirror/[email protected] deduped
│ └── @codemirror/[email protected] deduped
├─┬ @codemirror/[email protected]
│ ├─┬ @codemirror/[email protected]
│ │ └── @codemirror/[email protected] deduped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants