Activities of "Kaspars.Avotins"

Thanks, workaround works with wsl2.

Sadly we have .net console application that runs proxy-generation and then fixes/changes some of the files.

Anyway, thanks workaround works.

With this nothing happens. No error, just nothing happens.

If I change url to something incorrect I get error. [API Not Available] Request to https://localhost:4432/api/abp/api-definition is unsuccessful. Please double-check the URL in the source pro ject environment and make sure your application is up and running.

I simply get this standard error:

`> node --stack-size=1200 ./node_modules/.bin/ng g @abp/ng.schematics/collection.json:proxy-add --module __default --apiName __default --source __default --target __default --url https://localhost:44329

D:\Projects\iRMS\iRMS.Frontend\node_modules.bin\ng:2 basedir=$(dirname "$(echo "$0" | sed -e 's,\,/,g')") ^^^^^^^

SyntaxError: missing ) after argument list at Object.compileFunction (node:vm:352:18) at wrapSafe (node:internal/modules/cjs/loader:1033:15) at Module._compile (node:internal/modules/cjs/loader:1069:27) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) at node:internal/main/run_main_module:17:47`

Link to response with types: response with types

Will try workaround tomorrow. Simply adding and running it didnt work got some errors. I presume this is abp version 5.3.3? What node version are you running this with?

Hello,

I created a new app with ABP version 5.3.3. I tried proxy generation with url param. Proxy generation works fine as expected.

I took a screen recording. You can access the related video from this link

Can you share the result of 'yarn why @abp/ng.schematics' command in your angular directory?

Thank you, there was problem with @abp/ng.schematics version.

Now it works for: abp: v5.3.3 node: v14.20.0 Still problem with endpoints max count. Can you give us any time estimates for 5.3-patch-final? Like weeks or months?

Not working for different node version: abp: v5.3.3 node: v16.15.0; v18.6.0; Just in case if you didn't notice previously this is not same error as with endpoint max count.

RangeError: Maximum call stack size exceeded at formatWithOptionsInternal (node:internal/util/inspect:2246:40) at format (node:internal/util/inspect:2100:10) at console.warn (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular\cli\lib\cli\index.js:45:39) at Observable._trySubscribe (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\Observable.js:55:25) at Observable.subscribe (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\Observable.js:30:22) at MergeMapOperator.call (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\operators\mergeMap.js:37:23) at Observable.subscribe (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\Observable.js:25:31) at DefaultIfEmptyOperator.call (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\operators\defaultIfEmpty.js:27:23) at Observable.subscribe (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\Observable.js:25:31) at TakeLastOperator.call (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\operators\takeLast.js:38:23)

Hello,

Did you update the "@abp/ng.schematics" package version also?

I was able to reproduce the range error. You can follow the status of issue


Updated schematics and tested again, same url error for later abp version: @abp/ng.schematics: v5.3.3 abp: v5.3.3 node: v14.20.0; v16.15.0; v18.6.0;

Unknown option: '--url' Unknown option: 'https://localhost:44329/' Microsoft Windows [Version 10.0.19042.1826] (c) Microsoft Corporation. All rights reserved.

Ok, so again.

As stated in previous ticket there is still url error. Here are some tests.


abp: v5.3.0-rc.2; v5.3.0-rc.3; v5.3.1; v5.3.3; node: v14.20.0; v16.15.0; v18.6.0;

Unknown option: '--url' Unknown option: 'https://localhost:44329/' Microsoft Windows [Version 10.0.19042.1826] (c) Microsoft Corporation. All rights reserved.


abp: v5.2.0-rc.2; v5.2.1; node: v16.15.0; v17.3.0; v18.6.0 RangeError: Maximum call stack size exceeded at formatWithOptionsInternal (node:internal/util/inspect:2167:40) at format (node:internal/util/inspect:2021:10) at console.warn (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular\cli\lib\cli\index.js:45:39) at Observable._trySubscribe (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\Observable.js:55:25) at Observable.subscribe (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\Observable.js:30:22) at MergeMapOperator.call (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\operators\mergeMap.js:37:23) at Observable.subscribe (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\Observable.js:25:31) at DefaultIfEmptyOperator.call (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\operators\defaultIfEmpty.js:27:23) at Observable.subscribe (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\Observable.js:25:31) at TakeLastOperator.call (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\operators\takeLast.js:38:23)


And now as stated before only version we found working is this. But now we get error when there is too many endpoints. As you asked for definition file it loads and there is no error (Takes some time thought). Here is url to response. api/abp/api-definition response abp: v5.2.1; node: v14.20.0;

--maximums call stack. RangeError: Maximum call stack size exceeded at Observable._trySubscribe (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\Observable.js:51:34) at Observable.subscribe (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\Observable.js:30:22) at MergeMapOperator.call (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\operators\mergeMap.js:37:23) at Observable.subscribe (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\Observable.js:25:31) at DefaultIfEmptyOperator.call (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\operators\defaultIfEmpty.js:27:23) at Observable.subscribe (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\Observable.js:25:31) at TakeLastOperator.call (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\operators\takeLast.js:38:23) at Observable.subscribe (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\Observable.js:25:31) at ThrowIfEmptyOperator.call (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\operators\throwIfEmpty.js:30:23) at Observable.subscribe (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\Observable.js:25:31)

  • ABP Framework version: v5.2.1

  • UI type: Angular

  • DB provider: EF Core

  • Node version: 14.20.0

  • Problem with abp generate-proxy -t ng: RangeError: Maximum call stack size exceeded at Observable._trySubscribe (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\Observable.js:51:34) at Observable.subscribe (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\Observable.js:30:22) at MergeMapOperator.call (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\operators\mergeMap.js:37:23) at Observable.subscribe (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\Observable.js:25:31) at DefaultIfEmptyOperator.call (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\operators\defaultIfEmpty.js:27:23) at Observable.subscribe (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\Observable.js:25:31) at TakeLastOperator.call (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\operators\takeLast.js:38:23) at Observable.subscribe (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\Observable.js:25:31) at ThrowIfEmptyOperator.call (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\operators\throwIfEmpty.js:30:23) at Observable.subscribe (D:\Projects\iRMS\iRMS.Frontend\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\Observable.js:25:31)

  • First this is not fixed but closed. Why?: https://support.abp.io/QA/Questions/3185/Generate-proxy-issue-Angular We found that with abp v5.2.1 and node version 14.20.0 it works. (At least for Windows) That is reason for using older abp and node versions.

  • This range exception occurs at large endpoint count. If added any new endpoint this error will be thrown. If you delete any of old endpoints it works again for new service/endpoint.

MyRepositoryBase<TEntity> : EfCoreRepository<BookStoreDbContext, TEntity> where TEntity : class, IEntity and MyRepositoryBase<TEntity, TKey> : EfCoreRepository<BookStoreDbContext, TEntity, TKey> where TEntity : class, IEntity<TKey>

also tried to extend RepositoryBase directly. Nothing worked for me and as I stated in examples everything works fine when using AddRepository for specific entity.

If you can provide me with simple ef core example project where SetDefaultRepositoryClasses is working it would be great. With actual implementation since MyRepositoryBase gets registered to services, but with wrong state or something. Because it is not injected and is ignored.

It registers your custom class as IRepository<> and IBasicRepository<>. So, if some class injects one of them, your custom class will be used.

The following Unit Test should explain clearly: https://github.com/abpframework/abp/blob/e3e1779de6df5d26f01cdc8e99ac9cbcb3d24d3c/framework/test/Volo.Abp.Ddd.Tests/Volo/Abp/Domain/Repositories/RepositoryRegistration_Tests.cs#L169

UnitTest shows that class is indeed registered.

But same happens to my projects, class is registered but not injected. For example we will have two entities Author and Book and context BookStoreDbContext.

Example 1:

context.Services.AddAbpDbContext<BookStoreDbContext>(options => { options .AddDefaultRepositories<BookStoreDbContext>(true) .SetDefaultRepositoryClasses( typeof(MyRepositoryBase<,>), typeof(MyRepositoryBase<>) ); }

If we look through registered services we can find that MyRepositoryBase was indeed registered for each entity. (There is 8 registered instances for each entity with interfaces IReadOnlyBasicRepository, IReadOnlyRepository, IBasicRepository, IRepository with and without key)

BUT when I inject IRepository<Author, Guid> my base repository MyRepositoryBase is ignored.

Example 2:

context.Services.AddAbpDbContext<BookStoreDbContext>(options => { options.AddRepository<Author, MyRepositoryBase<Author, Guid>>(); }

If we look through registered services we can find that MyRepositoryBase was indeed registered for entity Author.

When I inject IRepository<Author, Guid> eveything works as expected. MyRepositoryBase is not ignored and is injected.

Example 3:

context.Services.AddAbpDbContext<BookStoreDbContext>(options => { options .AddDefaultRepositories<BookStoreDbContext>(true) .SetDefaultRepositoryClasses( typeof(MyRepositoryBase<,>), typeof(MyRepositoryBase<>) ); } options.AddRepository<Book, MyRepositoryBase<Book, Guid>>(); is converted to options.AddRepository<>();

Same as before MyRepositoryBase registered for every entity.

When I inject IRepository<Author, Guid> my base repository MyRepositoryBase is ignored. When I inject IRepository<Book, Guid> eveything works as expected. MyRepositoryBase is not ignored and is injected.


Testing done on ABP Framework version: 4.4.3 and 5.0.1

As I told before I do not understand how I am supposed to set up base repository.

Could you provide working example project with ef core where SetDefaultRepositoryClasses is working. Or some workaround? Or explanation what I am not understanding.

Showing 1 to 10 of 11 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on December 26, 2024, 06:07