Skip to content

Error: Module build failed: [object Object] #53678

@crutchcorn

Description

@crutchcorn

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

https://stackblitz.com/github/crutchcorn/angular-object-object-bug?file=src%2Fmain.ts&template=node

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions