Repository navigation
Closed
Labels
Milestone
Description
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
Yes
Description
When passing a number in a component:
import "zone.js";
import { bootstrapApplication } from "@angular/platform-browser";
import { Component, Input } from "@angular/core";
@Component({
selector: "display-size",
standalone: true,
template: `<p>Test</p>`,
})
class DisplaySizeComponent {
@Input() bytes!: number;
}
@Component({
selector: "app-root",
standalone: true,
imports: [DisplaySizeComponent],
template: `
<display-size [bytes]="123" />
`,
})
export class AppComponent {}
bootstrapApplication(AppComponent);It seems to throw an [object Object] error
Please provide a link to a minimal reproduction of the bug
Please provide the exception or error you saw
Build at: 2023-12-21T17:46:12.035Z - Hash: cc1a53dd72abbe97 - Time: 3228ms
./src/main.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: [object Object]
Please provide the environment you discovered this bug in (run ng version)
Angular CLI: 17.0.7
Node: 18.18.0
Package Manager: npm 9.4.2
OS: linux x64
Angular: 17.0.8
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1700.7
@angular-devkit/build-angular 17.0.7
@angular-devkit/core 17.0.7
@angular-devkit/schematics 17.0.7
@angular/cli 17.0.7
@schematics/angular 17.0.7
rxjs 7.8.1
typescript 5.2.2
zone.js 0.14.2
Anything else?
I sincerely apologize if I'm doing something wrong. I'm working with a lot of frameworks at the moment so it's possible I'm using a wrong syntax or something. I promise I double and triple checked
Activity
JoostK commentedon Dec 21, 2023
This is super weird.
With the
applicationbuilder (using vite/esbuild) I see the following:with
browser(using webpack) it's indeed onlyIn one incremental rebuild (using webpack) I got the following, revealing the root cause:
That is still buggy though, as errors should never be reported in
.ngtypecheck.tsfiles. I can't easily reproduce the above behavior.Exporting the component does avoid the issues, both in webpack as well as vite.
ilirbeqirii commentedon Dec 22, 2023
This issue will go away the moment you export DisplaySizeComponent too.
crutchcorn commentedon Dec 25, 2023
Interestingly, removing
exportfromAppComponentalso appears to solve this. I'm not sure I understand why in either case.devversion commentedon Feb 7, 2024
This should be fixed now with #54309
angular-automatic-lock-bot commentedon Mar 9, 2024
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.