MaaxGr / ang-jsoneditor

Jsoneditor for Angular 11, 12, 13 and 14
MIT License
13 stars 16 forks source link

Support for Angular 13 #4

Closed hansioan closed 2 years ago

hansioan commented 2 years ago

Hello,

I am currently starting a new project and decided to work with the latest Angular (13 at this moment) and my next steps will require me to make a JSON editor ... or use one

I saw your repo fork and I also see that for Angular 13 support but it says "Work in Progress" and there is no npm command for Angular 13.

So I tried running using Angular 12 with npm install @maaxgr/ang-jsoneditor@12 and the output was the one below and in the end my ng serve just hangs

$ ng serve
⠙ Generating browser application bundles (phase: setup)...(node:39691) UnhandledPromiseRejectionWarning: Error: The target entry-point "@maaxgr/ang-jsoneditor" has missing dependencies:
 - jsoneditor

    at TargetedEntryPointFinder.findEntryPoints (file://{path-to-angular-project}/test-json-editor/node_modules/@angular/compiler-cli/bundles/ngcc/index.js:4616:13)
    at file://{path-to-angular-project}/test-json-editor/node_modules/@angular/compiler-cli/bundles/ngcc/index.js:5008:33
    at SingleProcessExecutorSync.doExecute (file://{path-to-angular-project}/test-json-editor/node_modules/@angular/compiler-cli/bundles/ngcc/index.js:14633:23)
    at file://{path-to-angular-project}/test-json-editor/node_modules/@angular/compiler-cli/bundles/ngcc/index.js:14654:35
    at SyncLocker.lock (file://{path-to-angular-project}/test-json-editor/node_modules/@angular/compiler-cli/bundles/ngcc/index.js:14884:14)
    at SingleProcessExecutorSync.execute (file://{path-to-angular-project}/test-json-editor/node_modules/@angular/compiler-cli/bundles/ngcc/index.js:14654:19)
    at mainNgcc (file://{path-to-angular-project}/test-json-editor/node_modules/@angular/compiler-cli/bundles/ngcc/index.js:15985:19)
    at Module.process2 (file://{path-to-angular-project}/test-json-editor/node_modules/@angular/compiler-cli/bundles/ngcc/index.js:16050:10)
    at NgccProcessor.processModule ({path-to-angular-project}/test-json-editor/node_modules/@ngtools/webpack/src/ngcc_processor.js:182:27)
    at {path-to-angular-project}/test-json-editor/node_modules/@ngtools/webpack/src/ivy/host.js:146:18
(Use `node --trace-warnings ...` to show where the warning was created)
(node:39691) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:39691) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
⠇ Generating browser application bundles (phase: setup)...

Do you have any plans on making a stable npm package for Angular 13? You also say in the repo description

This is a fork of mariohmol's ang-jsoneditor with support for Angular 11, 12 and 13.

Do you have any tips on how to get it to work on Angular 13?

Thanks a lot

rr-hornback commented 2 years ago

You need to install jsoneditor:

npm install --save jsoneditor

MaaxGr commented 2 years ago

I updated the README.md to be more clear that jsoneditor npm lib has to be installed also. The library is now also compatible with Angular 13, see https://github.com/MaaxGr/ang-jsoneditor/releases/tag/13.0.3.

Watch out the the module name has changed to AngJsoneditorModule.

Issue should be resolved. If you have any questions. Feel free to ask!