Analog not working in Webkit based browsers

This issue has been tracked since 2023-01-10.

Please provide the environment you discovered this bug in.

Analog Project's do not work in webkit based browsers.
I believe it has something to do with the Vite Angular plugin.

Unfortunately, you cannot reproduce this in a StackBlitz example so I cloned the analog repo and added my tests to the blog-app & analog-app applications, which both show the same behavior

Which area/package is the issue in?

vite-plugin-angular

Description

Steps to reproduce:

  1. Add some basic functionality to the AppComponent, e.g.
@Component({
  selector: 'analogjs-root',
  standalone: true,
  imports: [TopBarComponent, RouterOutlet],
  template: `
    <app-top-bar></app-top-bar>

    Counter: {{count}}
    <button (click)="increment()">Increment</button>

    <div class="container">
      <router-outlet></router-outlet>
    </div>
  `,
})
export class AppComponent {
  public count = 0;
  public increment(): void {
    this.count++;
  }
}
  1. Open a webkit based browser such as Safari (on MacOS/iOS), but also Chrome on iOS
  2. Click on the Increment button

Expected Result
The counter increases on every click.

Actual Result
The counter does not increase.
The console shows the following error:
Screenshot 2023-01-10 at 10 52 35 AM

If you drill into the error the following is shown:
image

Please provide the exception or error you saw

[Error] SyntaxError: Unexpected token '{'
	(anonymous function) (app.component.ts:12)

Other information

I would love to submit a PR to fix this issue but I currently am lacking the knowledge where to even start investigating this issue.

I would be willing to submit a PR to fix this issue

  • Yes
  • No
brandonroberts wrote this answer on 2023-01-11
More Details About Repo
Owner Name analogjs
Repo Name analog
Full Name analogjs/analog
Language TypeScript
Created Date 2022-07-06
Updated Date 2023-03-28
Star Count 885
Watcher Count 18
Fork Count 67
Issue Count 33

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date