sibiraj-s / ngx-editor

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

[Bug]: Unexpected token ':' #520

Closed dilbarov closed 1 month ago

dilbarov commented 2 months ago

What happened?

When I use the module in SSR, I get a SyntaxError: Unexpected token ':' error

Version

v16.0.1

Angular Version

v17.1.1

What browsers are you seeing the problem on?

Chrome

Link to reproduce

No response

Relevant log output

[vite] Error when evaluating SSR module /main.server.mjs:
|- SyntaxError: Unexpected token ':'
    at new AsyncFunction (<anonymous>)
    at instantiateModule (file:///some-project/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:50858:28)

Willing to submit a PR?

None

sibiraj-s commented 2 months ago

SSR is not supported as the editor heavily relies on client side api's to work.

dilbarov commented 2 months ago

SSR is not supported as the editor heavily relies on client side api's to work.

This worked fine in version 15

sibiraj-s commented 2 months ago

Not really sure whats changed here. The library side changes are very minor.

Few noticeable things between 15-16 are

  1. added trusted types support
  2. set package sideEffects to false
  3. Angular 16 support.

Since it was not intended to be SSR compatible, never tested there.

dilbarov commented 1 month ago

The problem is in the build with vite in dev mode. There is an error with the prose mirror library.Because this construct does not work in strict mode.

Issue can be closed

sibiraj-s commented 1 month ago

Thanks for figuring this out.

github-actions[bot] commented 3 weeks 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.