Open aarona opened 2 years ago
After a little more investigating it looks like this issue may be coming from @types/draft-js
. When I import that Editor
component from directly from that package, I'm still getting a similar error.
types/draft-j
I encountered the same error. How did you fix the error finally? Thanks!
this shouldnt be closed , I have the same error , I even changed the types.d.ts and still nothing!!
types/draft-j
I encountered the same error. How did you fix the error finally? Thanks!
Sorry for this very late reply!
I was doing a major upgrade of my js packages and this wasn't working so I started using another WYSIYG editor, during the time I was in the middle of swapping this one out for another, a newer version of this (or related) package(s) was pushed and I was able to come back to this editor with no issue.
Below, is my projects current package.json
file that is working for me right now:
{
"name": "client",
"version": "0.1.0",
"private": true,
"proxy": "http://localhost:3001",
"dependencies": {
"@apollo/client": "^3.6.2",
"@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1",
"@mui/icons-material": "^5.6.2",
"@mui/material": "^5.6.4",
"@mui/styles": "^5.6.2",
"@types/draft-js": "^0.11.9",
"@types/draftjs-to-html": "^0.8.0",
"@types/jwt-decode": "^3.1.0",
"@types/lodash": "^4.14.182",
"@types/luxon": "^2.3.2",
"@types/react-dom": "^18.0.3",
"@types/react-draft-wysiwyg": "^1.13.4",
"@types/react-router-dom": "^5.1.3",
"@types/yup": "^0.29.13",
"apollo-link-error": "^1.1.13",
"apollo-link-token-refresh": "^0.4.0",
"draft-js": "^0.11.7",
"draftjs-to-html": "^0.9.1",
"eslint-config-react-app": "^7.0.1",
"formik": "^2.2.9",
"graphql": "^16.4.0",
"html-react-parser": "^1.4.12",
"immutable": "^4.0.0",
"jwt-decode": "^3.1.2",
"lodash": "^4.17.20",
"luxon": "^2.3.2",
"notistack": "^2.0.4",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-draft-wysiwyg": "^1.14.7",
"react-router-dom": "^6.3.0",
"react-scripts": "5.0.1",
"typescript": "^4.6.4",
"yup": "^0.32.11"
},
"scripts": {
"start": "node server.js",
"dev-start": "react-scripts start",
"build": "GENERATE_SOURCEMAP=false react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"gen": "graphql-codegen --config codegen.yml"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@babel/core": "^7.17.10",
"@babel/plugin-syntax-flow": "^7.14.5",
"@babel/plugin-transform-react-jsx": "^7.14.9",
"@graphql-codegen/cli": "^2.6.2",
"@graphql-codegen/introspection": "^2.1.1",
"@graphql-codegen/typescript": "^2.4.9",
"@graphql-codegen/typescript-operations": "^2.3.6",
"@graphql-codegen/typescript-react-apollo": "^3.2.12",
"@types/node": "^17.0.31",
"@types/react": "^18.0.8",
"@typescript-eslint/eslint-plugin": "^5.22.0",
"@typescript-eslint/parser": "^5.22.0",
"eslint": "^8.1.0",
"graphql-tag": "^2.0.0"
}
}
this shouldnt be closed , I have the same error , I even changed the types.d.ts and still nothing!!
You're correct. I closed this prematurely as I felt I was barking up the wrong tree but you're correct, this does need to be fixed. Reopening...
I have removed node_modules and lock files and re run npm install, and it got solved . My guess is that lock files used a wrong version or sth, but yeah that's how I got through
Full Error message:
Im importing the component like this:
Here is my
package.json
file: