Angular routing functions flawlessly on Chrome Mac but encounters issues on Chrome iOS

Encountering a strange issue. My routing is properly configured and has been verified multiple times.

Oddly enough, page1, page3, and page5 are functioning correctly, while page2, page4, and page6 fail to redirect as expected.

Upon clicking the redirect button for page2, it takes me to the landing page instead. Even manually entering https://example.com/page2 results in the same: https://example.com without any content displayed.

Please review the routes provided below.

const routes: Routes = [
  { path: '', component: LandingComponent},
  { path: 'page1', component: Page1Component},
  { path: 'page2', component: Page2Component},
  { path: 'page3', component: Page3Component},
  { path: 'page4', component: Page4Component},
  { path: 'page5', component: Page5Component},
  { path: 'page6', component: Page6Component},
  { path: '**', component: NotFound404Component}
  ];

Furthermore, there seems to be an issue with a particular component failing to load.

@Component({
  selector: 'app-page2',
  templateUrl: './page2.component.html',
  styleUrls: ['./page2.component.scss'],
  animations: [
    trigger('animation1', [
      transition('void => *', useAnimation(flip))
    ]),
    trigger('animation2', [
      transition('void => *', useAnimation(bounceInDown), {
        params: { timing: 3}
      })
    ])
  ]
})
export class Page2Component implements OnInit {

  constructor(public some: SomeService) { }

  ngOnInit(): void {
  }

}

The main issue appears to be with Chrome on iOS, unlike MacOS where everything works seamlessly - even when emulating an 'iPhone' device.

Any suggestions or insights would be greatly appreciated.

Answer №1

Thank you everyone, I have successfully found the solution.

The log below shows:

LOGResolveEnd(id: 4, url: '/page2', urlAfterRedirects: '/page2', state: Route(url:'', path:'') { Route(url:'page2', path:'page2') } )
LOGNavigationError(id: 4, url: '/page2', error: Error: The animation trigger "animation1" has failed to build due to the following errors:
The provided animation property "backface-visibility" is not a supported CSS property for animations)
  ERRORERROR Error: Uncaught (in promise): Error: The animation trigger "animation1" has failed to build due to the following errors:
The provided animation property "backface-visibility" is not a supported CSS property for animations

The "bv" property is not compatible with Chrome (iOS), causing the animation error.

Solving this issue is straightforward if you understand how to troubleshoot routing in Chrome (iOS). Just follow these two simple steps:

  1. Add this constructor to AppModule.
export class AppModule {
  constructor(private readonly router: Router) {
    router.events
      .subscribe(console.log)
  }
}
  1. chrome://inspect - this will grant access to Chrome (iOS) logs.

Using different animation options can prevent errors on various devices. It's advisable to incorporate this into testing procedures.

Answer №2

The potential issue you're facing could be due to Chrome on iOS utilizing WebKIT as its browser engine.

Make sure to test your content on Safari too, as Apple restricts other browser implementations apart from Webkit.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Changing the output of a service by using spyOn: A step-by-step guide

There is a specific service available: export class CounterService { random: any = { value: 123, date: 456, }; getRandom() { return this.random; } } A certain component utilizes this service. Within this component, the variable &apos ...

What is the proper way to utilize the ES6 import feature when using a symbolic path to reference the source file?

I am seeking a deeper understanding of the ES6 import function and could use some assistance. The Situation Imagine that I have a portion of code in my application that is frequently used, so I organize all of it into a folder for convenience. Now, in t ...

When conducting tests, TypeScript raises an issue when comparing the values of array elements subsequent to performing a shift()

I am working with an array of strings, which was created by splitting a larger string using the `split` operation. Specifically, I am performing some tests on the first two elements of this array: var tArray = tLongString.split("_") if (tArray[0] == "local ...

The primary route module is automatically loaded alongside all other modules

I have configured my lazy loaded Home module to have an empty path. However, the issue I am facing is that whenever I try to load different modules such as login using its URL like /new/auth, the home module also gets loaded along with it. const routes: R ...

What is the correct way to handle the return value of an useAsyncData function in Nuxt 3?

How can I display the retrieved 'data' from a useAsyncData function that fetches information from a pinia store? <script setup lang="ts"> import { useSale } from "~/stores/sale"; const saleStore = useSale(); const { da ...

What is the best way to define 'this' context and reference an instance of an Angular 6 component?

I have successfully created a demo featuring an Earth globe using D3 and JS. Now, I am exploring the process of transforming it into an Angular 6 component. Below is the full demo without Angular: import * as d3 from 'd3v4'; import { Component ...

What could be causing the absence of the exported Object when importing into a different Typescript project?

I am currently in the process of developing a React component library using Typescript that I want to import into another Typescript project. Specifically, I want to import an Analytics chart library into a storybook for demonstration and testing purposes. ...

Example of a floating undo bar using a dynamic function in a Vuex store module

Issue Overview Trigger the mutation or action of Vuex store module A to execute an external function. This external function can belong to another Vuex store module (e.g. B). A should store a reference to the external method (e.g. mutation or action from ...

Is there a way to automatically scroll 50 pixels down the page after pressing a button?

Is there a way to make my page scroll down in Angular when a button is clicked? I attempted to use this code, but it didn't have the desired effect. What is the best method for scrolling the page down by 50px? window.scrollBy(0, 50); ...

Sending JSON information from the App Component to a different component within Angular 6

I am faced with a challenge involving two components: 1. App Component 2. Main Component Within app.component.ts: ngOnInit () { this.httpService.get('./assets/batch_json_data.json').subscribe(data => { this.batchJson = data ...

Looking for a way to display a spinner loader while transitioning between routes in Angular 4? Although I'm receiving events, I'm struggling to actually show the loader on screen

I'm currently working on a project that requires a loader to display between two routes. Although I am receiving route events, the loader is not visible. import { Component } from '@angular/core'; import { Router, Event, NavigationStart, Na ...

Using NextJs <Script> is only effective after a page has been reloaded

Currently delving into the world of NextJS and encountering an issue with integrating a third-party ebay script onto one of my route pages. The script only seems to appear sporadically upon reloading the page. However, when navigating to the store page via ...

What could be causing Typescript Intellisense to not display Object extensions?

Let's take a look at this unique way to extend the Object type: interface Object { doSomething() : void; } Object.prototype.doSomething = function () { //perform some action here } With this modification, both of the following lines will c ...

Utilizing a service within NestJS

I'm currently in the process of updating some older code and I have created a service that I want to inject into the constructor of a class. There are two key points to consider about this particular class. The first point is that it is instantiated b ...

Changing the time in Angular while converting a string to a date object has proven to be

Can anyone help me with a problem I'm having trying to convert a String into a Date object without it being affected by timezone changes? Specifically, when I receive 2020-07-14T15:27:39Z from an http get request, I need to convert this into a Date o ...

What is the best way to display information pulled from an API in Angular using ng2 charts?

Hello, can you lend me a hand? I'm currently facing an issue while attempting to display data using ng2 charts in my Angular application. The data is being fetched from a Firebase API, but unfortunately, it's not rendering properly and I can&apos ...

Is the RouterModule exclusively necessary for route declarations?

The Angular Material Documentation center's component-category-list imports the RouterModule, yet it does not define any routes or reexport the RouterModule. Is there a necessity for importing the RouterModule in this scenario? ...

Developing a discriminated union by utilizing the attribute names from a different type

In my quest to create a unique generic type, I am experimenting with extracting property names and types from a given type to create a discriminated union type. Take for example: type FooBar = { foo: string; bar: number; }; This would translate t ...

Steps to enable the submit button in angular

Here's the code snippet: SampleComponent.html <nz-radio-group formControlName="radiostatus" [(ngModel)]="radioValue" (ngModelChange)="onChangeStatus($event)"> <label nz-radio nzValue="passed">Passed</label> <label nz-rad ...

Is there a way to update JSON data through a post request without it getting added to the existing data?

Hello, I am currently delving into Angular2 and encountering a problem concerning RestAPI. When I send a post request to the server with a JSON file, I intend to update the existing data in the JSON file; however, what actually happens is that the new data ...