Closed mohammedfaisal closed 1 month ago
@mohammedfaisal there is maybe some react versions conflict in your project, could u please check that?
@AhmeeedMostafa See the repo https://github.com/mohammedfaisal/image-editor-vanilla for an example of the issue described.
@mohammedfaisal I see in your package-lock.json you have more than react version, this might be the issue. please run npm list react in your project's path terminal and see what packages have the different versions, and try to align the versions 1 version or remove that other packages and check if the lib. working good then this might be the reason.
@AhmeeedMostafa As you can see in the README.md of the repo: https://github.com/mohammedfaisal/image-editor-vanilla, I just executed the command that is specified in the documentation for using the VanillaJs version. I'm NOT using React at all; only the filerobot-image-editor library is using React. I'm not a React developer, that's why I'm interested in the VanillaJs variant of library.
Here is the output of npm list react
image-editor-vanilla@0.0.0 /home/faisal/dev/git/external/image-editor-vanilla
+-- filerobot-image-editor@4.8.0
| +-- react-dom@18.2.0
| | `-- react@18.2.0 deduped
| +-- react-konva@18.2.10
| | +-- its-fine@1.2.5
| | | `-- react@18.3.1 deduped
| | +-- react-reconciler@0.29.2
| | | `-- react@18.3.1 deduped
| | `-- react@18.3.1 deduped
| +-- react@18.2.0
| `-- styled-components@5.3.5
| `-- react@18.2.0 deduped
`-- react-filerobot-image-editor@4.8.0
+-- @scaleflex/icons@2.6.3
| `-- react@18.3.1 deduped
+-- @scaleflex/ui@2.7.0
| +-- @tippyjs/react@4.2.6
| | `-- react@18.3.1 deduped
| `-- react@18.3.1 deduped
+-- react-dom@18.3.1
| `-- react@18.3.1 deduped
+-- react@18.3.1
`-- styled-components@5.3.11
`-- react@18.3.1 deduped
@mohammedfaisal I've updated the versioning of the vanillajs's package.json to avoid such multiple react versions, so you could install the new version v4.8.1
That solved the issue. Thank you so much @AhmeeedMostafa
I have tried the image-editor using the VanillaJS approach by creating a vite project using vanilla template and installed the following dependency as mentioned in the github documentation.
npm install --save filerobot-image-editor react-filerobot-image-editor
Then I copy & pasted the VanillaJs Example provided in the github documentation. It produces javascript errors on page load - image editor not rendered at all.
The same code works fine when I used VanillaJs CDN :
<script src="https://scaleflex.cloudimg.io/v7/plugins/filerobot-image-editor/latest/filerobot-image-editor.min.js"></script>
The react example mentioned in the documentation also works fine.
Any idea about Javascript errors and what is wrong with the VanillaJS example ?