Comments (7)
Ah, thanks, I see now. The problem originates here:
angular/packages/compiler-cli/linker/babel/src/es2015_linker_plugin.ts
Lines 132 to 143 in 160171e
from angular.
@JoostK That patch fixes everything, thanks!
from angular.
This was the reason for the esbuild usage revert in ng-packagr, so I'd advise to update to not run into this problem. If esbuild is reintroduced into ng-packgr we'll look into why this happens and how it can be resolved.
from angular.
We're not using ng-packagr, we've got our own library builder, where we switched to esbuild earlier and we now have to revert because of this same issue.
from angular.
Could you please share (parts of) the library output that is consumed in the app?
from angular.
Dummy library passed through our pipeline: repro.zip
Here's the FESM file, where I added a comment showing where the constants are inserted
// dist/@something/redacted/esm2022/my-test.component.js
import { ChangeDetectionStrategy, Component } from "@angular/core";
import * as i0 from "@angular/core";
var MyTest = class _MyTest {
static {
this.\u0275fac = i0.\u0275\u0275ngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: _MyTest, deps: [], target: i0.\u0275\u0275FactoryTarget.Component });
}
static {
this.\u0275cmp = i0.\u0275\u0275ngDeclareComponent({ minVersion: "14.0.0", version: "18.0.2", type: _MyTest, isStandalone: true, selector: "my-test", ngImport: i0, template: `
<h1><ng-content select="[title]"></ng-content></h1>
<ng-content></ng-content>
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
};
i0.\u0275\u0275ngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: MyTest, decorators: [{
type: Component,
args: [{
standalone: true,
selector: "my-test",
template: `
<h1><ng-content select="[title]"></ng-content></h1>
<ng-content></ng-content>
`,
changeDetection: ChangeDetectionStrategy.OnPush
}]
}] });
// dist/@something/redacted/esm2022/test.module.js
import { NgModule } from "@angular/core";
import * as i02 from "@angular/core";
// <<---- This is where the `const _cX` variables are inserted
var TestModule = class _TestModule {
static {
this.\u0275fac = i02.\u0275\u0275ngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i02, type: _TestModule, deps: [], target: i02.\u0275\u0275FactoryTarget.NgModule });
}
static {
this.\u0275mod = i02.\u0275\u0275ngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.2", ngImport: i02, type: _TestModule, imports: [MyTest], exports: [MyTest] });
}
static {
this.\u0275inj = i02.\u0275\u0275ngDeclareInjector({ minVersion: "12.0.0", version: "18.0.2", ngImport: i02, type: _TestModule });
}
};
i02.\u0275\u0275ngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImport: i02, type: TestModule, decorators: [{
type: NgModule,
args: [{
imports: [MyTest],
exports: [MyTest]
}]
}] });
export {
MyTest,
TestModule
};
from angular.
@bgotink perhaps you could patch in #56431 locally to see if that resolves the issue you're having.
from angular.
Related Issues (20)
- When using ApplicationRef.bootstrap to bootstrap components Auto change detection does not work HOT 3
- Generación de paginas HOT 2
- JS Exception prevents downloading Tutorial Code HOT 2
- Allow Angular Templates to use the html template function from Lit? HOT 1
- "ng build" hangs HOT 2
- Control Flow - Allow wrapping element for `@for` HOT 1
- Looking for list of built-in pipes HOT 1
- Support video thumbnails for Cloudinary image loader
- Issue with using @for built-in template syntax while removing dynamic form array elements HOT 3
- Issues using angular cdk drag and drop with angular form array HOT 1
- @for(ID of IDs; track ID) and NG0956 - provide a way to prevent warning when tracking by item is legit scenario HOT 4
- The reset method of FormControl is setting the value to null instead of setting it to the initial value. HOT 2
- Example images from the Housing Location Tutorial missing HOT 2
- signals (or function calls in the templates) in language service HOT 3
- Detached DOM nodes HOT 4
- The `@angular/localize API` link directs to a 404 HOT 3
- Link gets broken with space character in its end HOT 1
- solution HOT 1
- Missing documentation for global `ng` variable HOT 1
- Some examples not showing in router API docs page HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular.