Missing imports in ESM .js
files do not produce errors (only warnings)
#14421
Milestone
.js
files do not produce errors (only warnings)
#14421
🐞 Bug report
Command (mark with an
x
)Is this a regression?
N/A
Description
When an esm5/esm2015
.js
file is trying to import a non-existing export, there is a warning emitted duringng build
, but no hard error. Note this only affects.js
files, since missing imports fail in.ts
files.For context:
We ran into this in angular/angular#30362, where esm files in
@angular/material
ended up trying to import missing exports from@angular/core
. The build succeeded (with warnings only), but the app is broken.(See angular/angular#30362 (comment) for more details.)
🔬 Minimal Reproduction
This is a contrived minimal reproduction that produces the same error as the one seen in angular/angular#30362:
npm install
.npm run build
.The repro project was created with
ng new test-app --defaults
and the following changes:src/main.ts
tosrc/main.js
inangular.json
.src/main.js
intsconfig.json > include
.src/main.ts
tosrc/main.js
and update its content to importmissingExport
from@angular/core
.🔥 Exception or Error
🌍 Your Environment
The text was updated successfully, but these errors were encountered: