Title: Missing imports in ESM `.js` files do not produce errors (only warnings) · Issue #14421 · angular/angular-cli · GitHub
Open Graph Title: Missing imports in ESM `.js` files do not produce errors (only warnings) · Issue #14421 · angular/angular-cli
X Title: Missing imports in ESM `.js` files do not produce errors (only warnings) · Issue #14421 · angular/angular-cli
Description: 🐞 Bug report Command (mark with an x) - [x] build 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 during ng build, but no hard error. Note this onl...
Open Graph Description: 🐞 Bug report Command (mark with an x) - [x] build 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 during ng...
X Description: 🐞 Bug report Command (mark with an x) - [x] build 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 during ng...
Opengraph URL: https://github.com/angular/angular-cli/issues/14421
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Missing imports in ESM `.js` files do not produce errors (only warnings)","articleBody":"# 🐞 Bug report\r\n\r\n### Command (mark with an `x`)\r\n```\r\n- [x] build\r\n```\r\n\r\n### Is this a regression?\r\nN/A\r\n\r\n\r\n### Description\r\nWhen an esm5/esm2015 `.js` file is trying to import a non-existing export, there is a warning emitted during `ng build`, but no hard error. Note this only affects `.js` files, since missing imports fail in `.ts` files.\r\n\r\nFor context:\r\nWe 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.\r\n(See https://github.com/angular/angular/pull/30362#issuecomment-492230220 for more details.)\r\n\r\n## 🔬 Minimal Reproduction\r\nThis is a contrived minimal reproduction that produces the same error as the one seen in angular/angular#30362:\r\n\r\n- Download and unzip [test-app.zip](https://github.com/angular/angular-cli/files/3178172/test-app.zip).\r\n- Run `npm install`.\r\n- Run `npm run build`.\r\n\r\nThe repro project was created with `ng new test-app --defaults` and the following changes:\r\n- Change `src/main.ts` to `src/main.js` in `angular.json`.\r\n- Add `src/main.js` in `tsconfig.json > include`.\r\n- Rename `src/main.ts` to `src/main.js` and update its content to import `missingExport` from `@angular/core`.\r\n\r\n\r\n## 🔥 Exception or Error\r\n\u003cpre>\u003ccode>\r\nWARNING in ./src/main.js 2:12-25\r\n\"export 'missingExport' was not found in '@angular/core'\r\n\u003c/code>\u003c/pre>\r\n\r\n\r\n## 🌍 Your Environment\r\n\u003cpre>\u003ccode>\r\nAngular CLI: 8.0.0-rc.3\r\nNode: 10.15.3\r\nOS: win32 x64\r\nAngular: 8.0.0-rc.3\r\n... animations, cli, common, compiler, compiler-cli, core, forms\r\n... language-service, platform-browser, platform-browser-dynamic\r\n... router\r\n\r\nPackage Version\r\n-----------------------------------------------------------\r\n@angular-devkit/architect 0.800.0-rc.3\r\n@angular-devkit/build-angular 0.800.0-rc.3\r\n@angular-devkit/build-optimizer 0.800.0-rc.3\r\n@angular-devkit/build-webpack 0.800.0-rc.3\r\n@angular-devkit/core 8.0.0-rc.3\r\n@angular-devkit/schematics 8.0.0-rc.3\r\n@ngtools/webpack 8.0.0-rc.3\r\n@schematics/angular 8.0.0-rc.3\r\n@schematics/update 0.800.0-rc.3\r\nrxjs 6.4.0\r\ntypescript 3.4.5\r\nwebpack 4.30.0\r\n\u003c/code>\u003c/pre>\r\n","author":{"url":"https://github.com/gkalpak","@type":"Person","name":"gkalpak"},"datePublished":"2019-05-14T14:22:28Z","url":"https://github.com/angular/angular-cli/issues/14421"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:35cca01d-5c31-f43c-bedb-6d61f659e1ca |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C94E:2E7EBB:F39D74:1345941:6B010A36 |
| html-safe-nonce | 18a1ea4712eead758249f9c350ee9163ac38dfa42dda3287a2f049ec5a5a0494 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTRFOjJFN0VCQjpGMzlENzQ6MTM0NTk0MTo2QjAxMEEzNiIsInZpc2l0b3JfaWQiOiI4NjQ5Mzk5OTMyMTMxODA1NzUwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 363b8653ab78d47ff2a09c61004b9d9568a4aaacacac14fe8503b72a0b05d114 |
| hovercard-subject-tag | issue:443944884 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/14421/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f72e5631fd51a28ee64860ea641393196d3ab31eb97747d440c55af55b210464/angular/angular-cli/issues/14421 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f72e5631fd51a28ee64860ea641393196d3ab31eb97747d440c55af55b210464/angular/angular-cli/issues/14421 |
| og:image:alt | 🐞 Bug report Command (mark with an x) - [x] build 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 during ng... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gkalpak |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width