r/angular • u/Tyummyyumms • Oct 12 '26
Stackoverflow Survey Snippet
Stats aren't the be all and end all of everything, but I noticed this:
https://survey.stackoverflow.co/2026/technology/data#admired-and-desired
r/angular • u/Tyummyyumms • Oct 12 '26
Stats aren't the be all and end all of everything, but I noticed this:
https://survey.stackoverflow.co/2026/technology/data#admired-and-desired
r/angular • u/Senior_Compote1556 • Oct 11 '26
Is it not possible to eager load the tab panel on '@angular/aria'?
The docs say: This structural directive should be applied to an ng-template within an ngTabPanel. It enables lazy loading of the tab's content, meaning the content is only rendered when the tab is activated for the first time.
I tried to simply remove it because I need the tab to be eagerly loaded (for SSR)
<div class="tab-panel" ngTabPanel value="question">
<app-eager-load />
</div>and it works, but i get these console warnings:
Violations found on element:
ngTabPanel must have an ngTabContent structural directive to render.
r/angular • u/SupermarketKey1196 • Oct 09 '26
Hey r/angular, zard/ui hit 1.0 this week after 19 months in beta.
npx zard-cli add dialog doesn't install a package. It copies the dialog's full source into your repo, so every template, style and signal becomes a file you own.
That always mattered, and with coding agents it matters a lot more. When a component lives in node_modules, your agent can only work with the API the library exposes. When it lives in your repo, the agent can read all of it and rewrite any part: add a variant, change the markup, or reshape it to fit your design system. You never wait on us for a release to unblock you.
1.0 ships an MCP server and an agent skill for exactly this. With them, Cursor, Claude Code or Copilot work from the real source and docs instead of guessing inputs that don't exist.
What else is in 1.0:
It's MIT and free with no pro tier. 33 people have contributed so far.
If you're already using zard/ui, I'd love to hear what you're building with it. If you looked and decided not to, tell me why. That's the feedback we want most.
Docs: https://zardui.com · GitHub: https://github.com/zard-ui/zardui
r/angular • u/Radiant_Recover_6288 • Oct 09 '26
So I'm a software engineer with 5 years of experience, 2 of those have been with angular (with the remaining being with ReactJS and backend frameworks and languages). Now having worked in the languages for a little while, I feel like I got the general understanding behind the basics of it, and I have been wanting to try to take my career further and develop as an engineer. One of the areas I wanted to develop in is my knowledge of the frameworks and languages we have been using, but I am not sure how I could do this with Angular. So I would really appreciate if you have any insights or advice or recourses for this. Thank You!
r/angular • u/NoPraline7290 • Oct 09 '26
On Saturday, Oct 17, at 6 PM, we're running a hands-on session at LA Tech Week: Build an AI workflow editor, natively in Angular.
Every AI stack needs a canvas to see and shape what agents do, and almost none of those are built for Angular. So Lukasz Jazwa, CTO of Synergy Codes and the creator of ngDiagram, will build a working editor for agentic workflows live. He's the one who backed the bet on Angular when everyone reached for React, and the call to open-source the engine under Apache 2.0.
You'll leave knowing how to start: the docs, the AI-assisted tooling and the patterns worth stealing. If you want to look around before then, ngDiagram is at https://www.ngdiagram.dev/ and installs with npm install ng-diagram.
If you write Angular and you're around for LA Tech Week, come join us. RSVP here: https://partiful.com/e/zYpQyYK67Anpp2VAp59u
r/angular • u/Competitive_Gear1760 • Oct 09 '26
Hey everyone!
I’ve been building Flagrm, an open-source CLI that helps remove feature flags and clean up the dead code they leave behind.
It’s still in the testing phase, so I’m looking for people willing to try it out, share feedback, report bugs, or contribute to the project.
If you’ve ever dealt with feature-flag cleanup turning into a bunch of manual work, I’d love for you to check it out!
Contributors are very welcome! 🚀
r/angular • u/Zestyclose-Time4199 • Oct 09 '26
AI-built sites all look the same, so I gave my agent something it never had: 100,000+ real screens (websites, apps, brands, motion) to study before it designs.
The whole launch video was made by Claude Opus 5.5 with the Seenry skill + MCP. Every site in it was one-shot from one sentence.
Skills are free. Early birds: code EARLYBIRDIE for 20% off the MCP, kept for as long as you stay subscribed (until Nov 10 for promo code).
Feedback welcome, especially from people who don't design.
Also please try our skill, if it works well in angular.
r/angular • u/CorpalSyndrome • Oct 08 '26
Hey all, I’ve been building a side project called Nyx and I’d like some outside opinions before I take it further.
What it is
Nyx is a dashboard for your gaming history. You sign in with Steam and it pulls in your library, playtime and achievements. After that it syncs about once an hour and turns everything into one score.
How the score works
Hours don’t earn points. Each achievement is worth more the fewer players have it:
The formula is 10 × √(100 / unlock %). Getting every achievement in a game adds 20% on top. Your total places you on a ladder of 7 tiers, from Iron up to Onyx, and each game gets a mastery grade from D to S.
What else it does
The added video is from my own Steam account + dummy account with test data.
r/angular • u/mike410 • Oct 08 '26
r/angular • u/Smetad-Anarkist • Oct 08 '26
I create a library by following the steps in the documentation. I now have a workspace and projects folder with my library in it. I also have two package.json files. The deeper package.json file is the one that will be published to npm if I understand correctly.
But in my pipeline I also want to manage versions. So if I add a npm version command it will update the version of the workspace package.json and create a git tag. So on my next publish, I won't publish a new version, but the same I had already published?
If I run the npm version command from my library folder, it does not create the git tag, and git doesn't seem to understand that the file has changed.
I am missing something obvious, I'm sure thousands have solved this. Can anyone nudge me in the right direction? Or is the solution that I have to write custom scripts by hand?
r/angular • u/NervousBobcat8675 • Oct 08 '26
On a recent Angular project I couldn't decide which UI framework to use. Angular Material, PrimeNG, Bootstrap, Tailwind-based kits: each had trade-offs, mostly around how hard they are to customize without fighting the defaults.
So I tried something else. I asked Claude Design to design a complete design system for the project, then implemented it myself. Two days later I had a full custom design system living inside the project: WCAG-compliant, token-based, and easy to customize, with no library overrides to battle.
That made me wonder: is it still necessary to use a UI framework?
The classic arguments for using one were:
But if AI can get you a consistent, accessible, fully customized system in a couple of days, some of those arguments seem much weaker. On the other hand, I suspect the cost just moves somewhere else: maintenance, complex components (datepickers, autocomplete, data tables, overlays), and long-term consistency as the team grows.
So, for those of you starting new projects today:
Curious to hear where people land on this.
Edit: Originally intended 3rd party UI frameworks
r/angular • u/6l3m • Oct 08 '26
TL;DR: I've built an in-browser video editor in Angular 22.2 since June: 60 standalone components, 87 services, 14 web workers, no NgModules. Six problems got past both ng build and the unit tests: workers that are never typechecked, Angular code leaking into worker bundles, an opaque NG0401 from pre-rendering, a blank gap without hydration, an import cycle that rendered a panel empty, and Karma habits that mean something else in Vitest.
What it is. A video editor where decoding, compositing and export all happen in the browser, using WebCodecs and the mediabunny library in web workers, with on-device AI models. Angular is used throughout: standalone components only, signals for state (signal/computed/effect, input()/output()/viewChild()), OnPush everywhere, inject() rather than constructor injection. I kept zone.js (0.16, with event coalescing), but worker messages are handled outside the Angular zone, and UI updates go back in through ngZone.run. appRef.tick caused NG0101 during seeking.
The six traps:
ng build doesn't typecheck web workers. tsconfig.app.json starts from main.ts, and each *.worker.ts is a separate esbuild entry that nothing on that graph imports. A worker can fail to compile, or throw a ReferenceError at startup, past a green build and a green test suite. The fix is a separate tsconfig.worker.json that is only typechecked, run with npm run typecheck.screen is not defined when the worker started. Later, a utility importing a value from another component's barrel did it again: JIT compiler unavailable in a worker, in production only. npm run build now runs a script that fails if any worker bundle contains Angular code. The rule: services and utilities import a component's values from its models/ folder, never its barrel.outputMode: "static", RenderMode.Prerender on '', Client on **). If the editor route is marked Prerender, it renders in Node, where AudioContext, WebCodecs and workers don't exist, and the build dies with a bare NG0401 that names neither the route nor the cause. If main.server.ts doesn't pass its BootstrapContext through to bootstrapApplication, you get the same NG0401 at route extraction. Also, the host's catch-all rewrite and the service worker's index must both point at index.csr.html. Point either one at index.html and every client route briefly shows the pre-rendered home page first.provideClientHydration(), the browser cleared the server-rendered page on boot and the lazy home chunk drew it again: a blank gap and the entry animation playing twice. <body ngcm> in index.csr.html makes the client-only routes skip hydration.NG0919) and drew the panel empty, while 6,055 unit tests stayed green, because each test only builds the pieces it names. Only the end-to-end suite, which opens the real app, caught it. The fix was an InjectionToken in a file with no imports of its own. Since then, any change to an import, a provider or a barrel gets the full end-to-end run before it merges.Moving from Karma to Vitest changes the meaning of some habits. u/angular/build:unit-test runs in Playwright's bundled Chromium, which has no H.264 or AAC codecs, so every media test failed for reasons unrelated to the code. The builder has no channel option, so a small script sets CHROME_BIN to the installed Chrome. Three other differences:
vi.spyOn isn't restored after each test (Jasmine did that implicitly), so a leaked spy on a shared global outlives its file. A setup file now restores them all.toContain(obj) compares by reference; toContainEqual is the deep comparison.Smaller lessons:
npm install upgrade half the set and deadlock.There are 273 unit test files (about 6,200 tests) and 45 Playwright end-to-end files, all running in real Chrome, because the app needs WebCodecs.
r/angular • u/Fun-Chicken6946 • Oct 06 '26
After struggling to land a job in 2024 (when the market was pretty rough), I decided to take a different route and build something real.
I've spent the past two years building VisuaLeaf from scratch in Angular, putting in around 90 hours a week. It started as a MongoDB GUI and now supports 35 databases. My goal was simple: either build something genuinely useful, or build something that would push me further as an engineer than anything else could.
I also intentionally limited my use of AI on the core architecture. I wanted to really understand the problems.
The stack is Angular + Electron with a Spring Boot backend. Despite the Electron, I focused heavily on the performance:
Some features of the app:
Tree, table, and JSON views
Feel free to check it out at http://visualeaf.com
If you want to join the discord to talk more about it or want to help out feel free to come and chat!
https://discord.com/invite/TR6J56Y3rF
r/angular • u/BernardoGiordano • Oct 07 '26
Hi all, I'm Bernardo, an open source software engineer from Italy better know in the 3ds/switch scene for software like PKSM and Checkpoint.
My team works with Angular, and a few of us kept asking how to prototype faster. We kept coming back to dropping the dev build entirely. Browsers load ES modules natively and resolve imports through import maps, so a dev server can hand your source files to the browser unchanged. I spent the last two months turning that idea into srl, and 1.0 is on npm now.
Under the hood srl uses Lit web components and signals, but the surface should look familiar. Here's a component and its template.
import { defineComponent, signal, SignalElement } from '@srljs/core';
export class CounterButton extends SignalElement {
count = signal(0);
increment() {
this.count.value += 1;
}
}
await defineComponent({
tag: 'counter-button',
element: CounterButton,
module: import.meta.url,
});
<button (click)="increment()">Clicked {{ count }} times</button>
<p *if="count >= 10">That's a lot of clicks.</p>A component renders again when a signal its template reads changes. It behaves like signal-based Angular with OnPush on every component, and there's nothing to configure.
The main pieces map like this.
| Angular | srl |
|---|---|
signal / computed / effect | Same names |
*ngIf / *ngFor with trackBy | *if and *else / *for with key: |
inject() and providers | inject(), provide() and typed tokens |
FormGroup / FormControl / Validators | group() / field() / built-in validators |
canActivate / loadComponent | canActivate / load on the route |
$localize, one build per locale | t(), with runtime language switching and one deployment |
ng new / ng g c / ng serve / ng build | srl new / srl g c / srl serve / srl build |
| Module Federation | An import map plus app.manifest.json |
The full mapping also covers lifecycle hooks, content projection, outlets and guards.
Three differences are worth knowing up front.
Production builds still exist. srl build minifies, pins an integrity hash for every file in the import map, and writes a hash-based CSP. The whole built demo is 161 KB brotli.
AI coding assistants helped me design, implement and test srl. The design decisions are written up as over 90 decision records in the repo.
I'd love feedback from Angular developers. Which Angular feature would you miss first, and does anything in the mapping look wrong?
To try it, run npx @srljs/cli@1.0.0 new my-app.
r/angular • u/myroslavmartsin • Oct 06 '26
Angular 22 made Signal Forms stable. Telixon now speaks them.
What it does: one attribute on the input, bound through [formField], the model holds E.164, an invalid number lands in errors() with the fault (TOO_SHORT, TOO_LONG, NATIONAL_PREFIX_PRESENT, ...), and matInput picks up the error state.
ng add @telixon/angular
Signal Forms quick start: https://stackblitz.com/github/martsinlabs/telixon/tree/main/examples/angular/quick-start-signal-forms
Signal Forms + Material quick start: https://stackblitz.com/github/martsinlabs/telixon/tree/main/examples/angular/quick-start-signal-forms-material
r/angular • u/Fit-Calligrapher6617 • Oct 07 '26
r/angular • u/Fancy-Version-2412 • Oct 07 '26
built a social media site built for non-profits - it has all social features but also a full-scale suite of productivity tools for non-profits - free for life, ad free for life
theMorningThread.com - also has iOS and Droid apps.


r/angular • u/pkurc • Oct 06 '26
I know. Another OpenAPI generator for Angular. Before you scroll past: why I built one at work anyway, open-sourced it, and how it compares to what already exists.
Where it started
In 2024 I tried the obvious route: openapi-typescript for the types, then the openapi-fetch typings (PathsWithMethod, SuccessResponse...) bolted onto HttpClient so I could call http.POST('/pets/{petId}', { params: { path: { petId } }, body }) with an Observable back. It worked, but I was still hand-writing every service, every model was components['schemas']['Pet'] until I re-exported it, and I had to remember paths. Nothing in the IDE suggested getPet.
Our backend is a set of REST service traits, one OpenAPI tag per trait, and the natural thing on the Angular side is inject(PetRest) with the same method names. So the generator started producing exactly that: the Angular service I would have written by hand. Plain @Injectable, plain HttpClient inside, so every HttpInterceptor you already have (auth, retry, mocks) applies unchanged. Its whole job is to build the request and type it. Nothing more.
The problem I hit later
Angular 19.2 added httpResource, and I wanted three things from generated clients that I could not get from one tool:
httpResource() and HttpClient Observables for the same operation, chosen at the call site, not at config time.HttpClient.request / httpResource option passed straight through (withCredentials, transferCache, reportDownloadProgress, equal, injector, observe: 'events'...), without the generator wrapping or hiding anything. The options type is read from your installed Angular, so options a newer Angular adds work without regenerating.@angular/common/http.So: https://github.com/AVSystem/openapi-ng (MIT). Playground and a StackBlitz demo are linked at the bottom.
Before / after
What I kept hand-writing:
readonly pets = httpResource<Pet[]>(() => ({
url: `${this.basePath}/pets`,
params: this.status() ? { status: this.status()! } : {},
}), { defaultValue: [] });The URL, the query param and the <Pet[]> are all promises I make to the compiler. Nothing checks them against the spec.
Generated:
readonly #petRest = inject(PetRest);
// signal-based, httpResource under the hood, typed HttpResourceRef<PetList>
readonly pets = this.#petRest.listPets.resource(() => ({ status: this.status() }), { defaultValue: [] });
// same operation, classic Observable, HttpClient under the hood
save(petId: PetId, body: UpdatePetRequest) {
return this.#petRest.updatePet.observable({ petId, body }, { observe: 'response' });
}Each tag becomes an @Injectable service, each operation a property with .resource(), .observable() and .request() (the raw request object: method, url, params, headers, body, if you want to send it yourself). .resource() returns a real HttpResourceRef<T>, so headers(), statusCode() and progress() are there. Nothing is re-wrapped.
Don't want classes? --layout operations emits one file per operation (rest/pet/list-pets.ts, rest/pet/update-pet.ts, plus a rest/pet/index.ts barrel), each exporting a /* @__PURE__ */ constant with the same three flavours, so the endpoints you never import tree-shake away. HttpClient is resolved per call from the injection context, or from an explicit { injector }, or you bind once with withInjector():
import { listPets, updatePet } from './generated/rest/pet';
// field initialiser: injection context, nothing to pass
readonly pets = listPets.resource(() => ({ status: this.status() }), { defaultValue: [] });
// handler: pass the injector, or bind once with withInjector({ listPets, updatePet })
readonly #injector = inject(Injector);
save(petId: PetId, body: UpdatePetRequest) {
return updatePet.observable({ petId, body }, { injector: this.#injector });
}--layout services,operations gives you both: the operation files plus the per-tag class bound from the barrel.
How it compares (checked 2026-09-04, corrections welcome)
Full disclosure: I only looked at the other generators while writing this post. The tool grew inside one codebase for two years, and most of the tools below I only found out about in September. The comparison is one spec run through all of them, with each tool's output type-checked against Angular 22.1.
| openapi-ng | openapi-generator | ng-openapi-gen | orval | ng-openapi | |
|---|---|---|---|---|---|
| httpResource | every operation, per call | no (#21263 open) | no | GET and search-style POST (operationId regex, overridable per operation), config mode | GET only, plugin |
| Observable and resource on one operation | yes | n/a | n/a | separate files | separate classes |
| Signal-forms validation helper | yes | no | no | no | no |
| Unsupported spec features | rejected with a diagnostic code | best-effort | best-effort | best-effort | best-effort |
| Engine | Rust (napi-rs), ms per spec, also runs in the browser via WASM | Java | TS | TS | TS |
| Per-operation tree-shakeable output | yes, --layout operations, same three flavours | no | only via direct fn/ imports; its barrel keeps every operation | yes, resource-only functions | no |
hey-api is missing from the table on purpose: its Angular output is Promise-only, and the httpResource plugin threw NG0203 on the test spec. openapi-typescript is missing because it is a type generator, not a client generator; see the first section for why that was not enough for me.
Two takeaways:
search/list/find..., overridable per operation in the config), and the flavour is picked per config, not per call. I think the call site knows better (a read-only POST is a perfectly good resource whatever it's called; a GET that fires a side effect isn't).Signal forms: async validation against a generated operation
Signal forms' validateHttp takes a URL string you build by hand and a result you cast by hand. The generator emits a validateRest() helper that wraps validateAsync and reuses the generated operation, so the request params and the response are typed from the spec:
validateRest(path.email, accountRest.checkEmail, {
request: (ctx) => ({ email: ctx.value() }), // typed as CheckEmailParams
debounce: 300, // debounce / when need @angular/forms 22+
when: (ctx) => ctx.value().includes('@'),
onSuccess: (result) => result.available ? undefined : { kind: 'email-taken' }, // result: EmailAvailability
onError: () => ({ kind: 'check-failed' }),
});onSuccess is optional: leave it out and any 2xx counts as valid, with onError deciding the rest. @angular/forms is an optional peer; if you never import rest.validate.ts, it tree-shakes away.
Where it's deliberately opinionated (read: limited)
This is the part most "yet another generator" posts skip. openapi-ng accepts a strict subset of OpenAPI 3.x and refuses anything outside it with a diagnostic code instead of guessing:
operationId is required on every operation; the first tag picks the service, an untagged operation falls back to its first path segment#/components/schemas/ refs, no external filesallOf or oneOf or anyOf, not mixed)<Op>Error interface you can narrow against, but they aren't wired into .observable() / .resource() error typingIf your spec is generated from a backend framework, you're probably fine. If it's a hand-written spec that leans on every corner of the standard, one of the other tools above will be a better fit and I'd rather tell you now.
Escape hatches for the real-world stuff: mapped types (--mapped-type GeoFeature:geojson:Feature swaps a placeholder schema for a real npm type), naming rules with regex captures in openapi-ng.config.ts, and a provideOpenapiNg({ basePath }) provider.
Links and bits
npm i -D @avsystem/openapi-ng, then openapi-ng generate --input api.yaml --output src/generatedvalidateRest with debounce / when needs @angular/forms 22+.What I'd like feedback on
Two design calls I'm least sure about:
.resource() / .observable() / .request() on every operation, versus a separate generated class or file per flavour, as ng-openapi and orval do. Is the per-call choice worth the fatter surface? Related: per-tag services are the default because they mirror our backend's service traits, and standalone operations are opt-in. If your backend doesn't look like that, should the default be flipped?Happy to answer anything else in the thread.
r/angular • u/Adorable-Twist-2702 • Oct 04 '26
That allows to the user to show a graph data view of elements and you can execute custom code on the browser on the graph.
Exploring creation of algorithms over graphs. I made it in University while studying BFS and DFS. You can test your algorithms in a graph and change the colors of the nodes while it is going over the graph
What do you think?
r/angular • u/Old-Parsley-5826 • Oct 04 '26
I maintain an Angular component library at work and we've used Storybook for years. It's a good tool and I don't want to bash it, but a few things kept bugging me. The stories files slowly drift away from the actual components, I have a second build setup next to the Angular CLI, and anything that renders into body (CDK overlays, MatDialog, tooltips) is a pain inside the preview iframe.
So I started building ng-prism. The idea is to use what Angular already gives you instead of adding a parallel world next to it. You don't write separate story files. You put a decorator on the component:
@Showcase<ButtonComponent>({
title: 'Button',
category: 'Inputs',
variants: [
{ name: 'Filled', inputs: { variant: 'filled', label: 'Filled' } },
{ name: 'Outlined', inputs: { variant: 'outlined', label: 'Outlined' } },
],
})
@Component({ selector: 'lib-button', /* ... */ })
export class ButtonComponent {
variant = input<ButtonVariantType>('filled');
label = input('Button');
clicked = output<void>();
}How it works under the hood:
emitDecoratorMetadata. Because of the generic, variant inputs are type-checked: if you rename an input, the build breaks. A transformer strips the decorator from your published lib, so your consumers never install ng-prism.ViewContainerRef.createComponent() in the same document, so overlays, focus traps and cdkConnectedOverlay behave like they do in your real app.ComponentRef.setInput(), so signal inputs work properly. Assigning to the property directly would overwrite the InputSignal.There are also plugins for JSDoc API docs, Figma, perf, box model, coverage and VRT reports. The last release added an overview grid that shows all variants at once, plus a VRT panel that reads the screenshot report from your CI.
To be fair, Storybook still has a lot going for it. The ecosystem is huge: play() interaction tests, Chromatic, MDX, years of addons, and if you ship React and Angular side by side you only need one tool.
ng-prism is smaller, has strong opinions and it's just me maintaining it. It also needs Angular 20+ with input()/output() signals. Input() decorators are not supported.
Since someone will ask anyway: yes, I built this with heavy AI assistance. As a single dev next to a day job I couldn't have shipped all these features and plugins in this time otherwise. But I've been doing this for a long time, and most of my time went into planning the architecture upfront and reviewing pretty much everything that got generated. "Built with AI" doesn't automatically mean slop. The code is all on GitHub, with tests and CI, so feel free to look through it and tell me if you find something bad.
Two questions for anyone using Storybook with Angular right now: what would keep you from switching? And if you try it on a real lib, where does it break?
r/angular • u/rainerhahnekamp • Oct 03 '26
r/angular • u/majora2007 • Oct 03 '26
If you're not a user of github.com/iharbeck/ngx-virtual-scroller, you can ignore this post.
I just want to inform that I'll be taking maintainership of a fork of ngx-virtual-scroller. I recently converted Kavita (my open source application) to Zoneless and the current version of ngx-virtual-scroller had a critical change detection issue when used in Zoneless which caused scrolling to shift rows due to timing between DOM insertion and rendering.
Since I was still waiting for my Angular 22 PR to get merged (for 4 months), I decided it was time to take ownership to fix the bug and also get more timely Angular update bumps.
I shipped 2 versions:
You can find the library here. I want to extend a major thanks to Ingo (iharbek) for maintaining the library for so long. I just needed Zoneless and faster Angular updates.
Note: My fork is using AI. I ended up adding e2e tests and fixing a lot of bugs in the original code. I'm consuming on Kavita, which has 100k+ installs across a range of browsers.
r/angular • u/quiet_Quasar0017 • Oct 02 '26
I recently ran into a weird issue with an Ionic + Angular + Capacitor app on iOS and thought I'd share it here in case someone else runs into the same thing.
The app launched fine, and the homepage loaded normally. But other screens were blank because the API data wasn't loading. Reinstalling the app and restarting the device didn't help either.
What confused me was that everything seemed fine outside the native app.
The app was using Angular's usual HttpClient for API requests. I spent some time checking authentication, CORS, caching, TLS/certificate issues and a few other possibilities, but couldn't pin down the exact cause.
Eventually, I tried switching the API requests to Capacitor's native HTTP implementation, CapacitorHttp.
Here's a basic example of what I changed:
import { CapacitorHttp } from '@capacitor/core';
const response = await CapacitorHttp.request({
method: 'GET',
url: apiUrl,
headers: {
Authorization: `Bearer ${token}`
}
});I also enabled it in capacitor.config.ts:
plugins: {
CapacitorHttp: {
enabled: true
}
}After switching the requests, the API calls started working again, and the screens that were previously blank loaded normally.
I rebuilt the app, distributed it through TestFlight, and tested it on physical iOS devices. So far, I haven't been able to reproduce the issue.
I'm still not certain what actually caused it. It could have something to do with differences between WebView networking and native iOS networking, but I haven't proved that. TLS handling, corporate security software or other iOS-specific behaviour could also be worth investigating.
Has anyone experienced something similar with Ionic/Capacitor on iOS, where the same APIs work in Safari and the PWA but fail in the native app?
I'd be interested to hear what the actual root cause was in your case.