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

ngx-jodit-pro: Angular 16 + vite + esbuild #7

Closed
vitorlopez opened this issue Jun 28, 2023 · 8 comments
Closed

ngx-jodit-pro: Angular 16 + vite + esbuild #7

vitorlopez opened this issue Jun 28, 2023 · 8 comments

Comments

@vitorlopez
Copy link

  • What version of the package?
    I've tried with the official version and the beta version with the same results.
    "jodit-pro": "^2.0.0-beta.18",
    "ngx-jodit-pro": "^2.0.0-beta.0",
  • What Angular version are you using?
    Angular 16 + esbuild

I know esbuild is probably not stable enough but I've been using it with Angular 16 with no problems since the official release. It is indeed a lot faster than webpack so I believe it's probably going to be adopted by more and more developers pretty soon.

It seems that the ngx-jodit-pro is doing something esbuild is not happy about. I did try to change a few tsconfig rules with no success so far.

It works for the final production build which is interesting and makes me believe there's some issue with Vite instead, but everything start working when I switch back to webpack as the dev server.

I'd really appreciate some help with this issue, Thank you.

Application bundle generation complete. [3.992 seconds]
Reloading client(s)...
✘ [ERROR] Could not resolve "./index"

    node_modules/ngx-jodit-pro/esm2020/ngx-jodit-pro.mjs:4:14:
      4 │ export * from './index';
        ╵               ~~~~~~~~~

2:02:51 PM [vite] error while updating dependencies:
Error: Build failed with 1 error:
node_modules/ngx-jodit-pro/esm2020/ngx-jodit-pro.mjs:4:14: ERROR: Could not resolve "./index"
    at failureErrorWithLog (/workspace/ui-v2/node_modules/@angular-devkit/build-angular/node_modules/esbuild/lib/main.js:1636:15)
    at /workspace/ui-v2/node_modules/@angular-devkit/build-angular/node_modules/esbuild/lib/main.js:1048:25
    at /workspace/ui-v2/node_modules/@angular-devkit/build-angular/node_modules/esbuild/lib/main.js:1512:9
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) (x2)
image
@julianpoemp
Copy link
Owner

@vitorlopez I'll release ngx-jodit-pro v3 beta with Angular 16 support soon, perhaps this solves the issue. The angular 16 package comes with an esm2022 and a fesm2022 build.

  1. Does esbuild prefer a specific type of build?
  2. Did you try to use other Angular libraries with esbuild that were created not especially for Angular 16? Perhaps this is a downwards compatibility issue

@vitorlopez
Copy link
Author

Hey @julianpoemp that would be great. Yea, I'm using other libraries that weren't necessarily built for Angular 16 and they're working like angular-google-charts just as an example.

The thing is, this works when I use the regular webpack build, so it has some connection with esbuild for sure. But I'll wait for v3 then to give it another try.

Thanks so much for the quick response.

@julianpoemp
Copy link
Owner

julianpoemp commented Jun 28, 2023

@vitorlopez I released ngx-jodit-pro v3.0.0-beta.0. You find installation instructions here:
https://www.npmjs.com/package/ngx-jodit-pro/v/3.0.0-beta.0

Please let me know if it works. I tested it in a v16 angular esbuild project and it worked :)

Edit: Do you use SSR?

@vitorlopez
Copy link
Author

@julianpoemp that did fix the issue! 🎉

We're not using SSR yet.

Thank you so much, you're fantastic!

@vitorlopez
Copy link
Author

I love the new standalone component, it's so much better not having to import the module anymore!

@achapman009
Copy link

achapman009 commented Nov 14, 2023

I am getting the same error but I am using the ngx-jodit 1.0.8 library. Is this able to be resolved here as well?
I recently upgraded to Angular 17.

Thank you.

@julianpoemp
Copy link
Owner

@achapman009 I think it's an issue with Angular 13 that was used to build ngx-jodit 1.0.8. Is it an option for you to use the ngx-jodit v3 beta and Jodit v4 beta (that was built with Angular 16 and should resolve this issue) ?

@achapman009
Copy link

@julianpoemp This resolved the issue, thank you for the quick response! Appreciate all your work.

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