sibiraj-s / ngx-editor

🖋️ Rich Text Editor for angular using ProseMirror
https://sibiraj-s.github.io/ngx-editor/
MIT License
424 stars 183 forks source link

[Bug]: NG Build and NPM start giving errors in ProseMirror under NGx- Editor #408

Closed johnantony92 closed 1 year ago

johnantony92 commented 1 year ago

What happened?

Ng build suddenly started giving for ngx-editor it seems like something from the update of prosemirror command it was working fine and started giving error in the last few days issue

Version

9.02

Angular Version

11

What browsers are you seeing the problem on?

Firefox, Chrome, Safari

Link to reproduce

No response

Relevant log output

No response

Willing to submit a PR?

No response

sibiraj-s commented 1 year ago

Please see the pinned issue for the cause and how to fix. https://github.com/sibiraj-s/ngx-editor/issues/406.

This happened due to the dependencies of ngx-editor introduced breaking changes in a non major version.

Since this is a very old version I won't be able to fix them. A a short fix. download the package from npm. Remove the caret semver from all the dependencies and use that by using local installation.

johnantony92 commented 1 year ago

@sibiraj-s Cant update the package to 13 since i got other dependencies .Also tried downloading the package and removing caret and publishing my private server but renaming the package is giving me this issue image

Can you help on this?otherwise i would have to go for major changes.Can we have a patch release for older package?

rko9 commented 1 year ago

when you say download package from npm, which package you referring too? I'm using yarn in place of npm. and ngx-editior version is 8.1.1

rko9 commented 1 year ago

@sibiraj-s Cant update the package to 13 since i got other dependencies .Also tried downloading the package and removing caret and publishing my private server but renaming the package is giving me this issue image

Can you help on this?otherwise i would have to go for major changes.Can we have a patch release for older package?

ngx-editior V13 requires angular 13. Need any solution or workaround for angular 11

sibiraj-s commented 1 year ago

You don't need to publish to private server. Just zip the changes and specify the path in the dependency under the same name

ngx-editor: file://path-to-zip 
sibiraj-s commented 1 year ago

You can get the tar like this

npm view ngx-editor@8 dist.tarball

It will give you the url for the tar. you can download.

johnantony92 commented 1 year ago

@sibiraj-s Understood .so you meant to create a .tgz from the local build and mentioned that in the pacakge.json depencies right?

johnantony92 commented 1 year ago

@sibiraj-s Or you are saying i would have to bundle .tgz file with the project?Is there something that i can do publish in the private server as bundling the tar with project wont be better idea .Each time during the publish using ci/cd it tries to install the dependencies so giving a local path wont work

sibiraj-s commented 1 year ago

Yeah, bundling with project is the shortest one. To publish under different name, it would require many changes, because of internal dependencies

sibiraj-s commented 1 year ago

Understood .so you meant to create a .tgz from the local build and mentioned that in the pacakge.json depencies right?

download the build. -> extract it -> pin all the dependencies -> rezip it. and use that.

rko9 commented 1 year ago

.tgz from the local build

Tried that adding tar as local dependency but still throwing same errors

Screenshot 2022-06-03 at 8 35 25 PM
sibiraj-s commented 1 year ago

Pin all the dependencies. Remove the caret and reinstall.

johnantony92 commented 1 year ago

@sibiraj-s .Understood the approach you mentioned but can we have a patch-package release ?So that it will be easier for all the people that are stuck with older version and cant update

sibiraj-s commented 1 year ago

Not sure, Several versions are affected. It's not possible to patch all. And there are several changes between versions. I don't have the bandwidth ATM. I can try this weekend. Can't be sure.

To avoid getting into these situations. I have pinned all dependencies for now.

johnantony92 commented 1 year ago

@sibiraj-s Done the local .tgz but still getting the error .Any idea about this image

sibiraj-s commented 1 year ago

Sorry I did not see the notification. Can you try clearing node modules and reinstall?

rko9 commented 1 year ago

Pin all the dependencies. Remove the caret and reinstall.

Tried That too, but same errors are still coming.

rko9 commented 1 year ago

@sibiraj-s Done the local .tgz but still getting the error .Any idea about this image

Did you get any solution for this error?

johnantony92 commented 1 year ago

@sibiraj-s Done the local .tgz but still getting the error .Any idea about this image

Did you get any solution for this error?

Not till now.Tried the same steps that @sibiraj-s mentioned not sure what went wrong

johnantony92 commented 1 year ago

Sorry I did not see the notification. Can you try clearing node modules and reinstall?

Tried that and removed package.lock.json but still getting image

sibiraj-s commented 1 year ago

@johnantony92 . Try this solution I was able to get the editor working in lower versions. https://github.com/sibiraj-s/ngx-editor/issues/409#issuecomment-1146745067.

You don't have to zip, just use npm overrides or yarn resolutions.

johnantony92 commented 1 year ago

@johnantony92 . Try this solution I was able to get the editor working in lower versions. #409 (comment).

You don't have to zip, just use npm overrides or yarn resolutions.

thanks @sibiraj-s image Is this how overrides work?

sibiraj-s commented 1 year ago

@johnantony92 . Try this solution I was able to get the editor working in lower versions. #409 (comment). You don't have to zip, just use npm overrides or yarn resolutions.

thanks @sibiraj-s image Is this how overrides work?

Yes @johnantony92 .

github-actions[bot] commented 1 year ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in the thread.