Title: ngcc cannot handle UMD factory without parameters ( renderFactoryParameters ) · Issue #34138 · angular/angular · GitHub
Open Graph Title: ngcc cannot handle UMD factory without parameters ( renderFactoryParameters ) · Issue #34138 · angular/angular
X Title: ngcc cannot handle UMD factory without parameters ( renderFactoryParameters ) · Issue #34138 · angular/angular
Description: 🐞 bug report Affected Package The issue is caused by package @angular/compiler-cli Is this a regression? Don't know Description As part of our internal library, we have simple module that has no dependencies (two of them actually, but he...
Open Graph Description: 🐞 bug report Affected Package The issue is caused by package @angular/compiler-cli Is this a regression? Don't know Description As part of our internal library, we have simple module that has no de...
X Description: 🐞 bug report Affected Package The issue is caused by package @angular/compiler-cli Is this a regression? Don't know Description As part of our internal library, we have simple module that has n...
Opengraph URL: https://github.com/angular/angular/issues/34138
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ngcc cannot handle UMD factory without parameters ( renderFactoryParameters )","articleBody":"\r\n# 🐞 bug report\r\n\r\n### Affected Package\r\nThe issue is caused by package @angular/compiler-cli\r\n\r\n### Is this a regression?\r\n\r\nDon't know\r\n\r\n### Description\r\n\r\nAs part of our internal library, we have simple module that has no dependencies (two of them actually, but here I'll pick the primitive one). When compiled, the UMD bundle looks something like this:\r\n\u003cpre>\u003ccode>\r\n(function (global, factory) {\r\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\r\n\ttypeof define === 'function' && define.amd ? define('us.test', factory) :\r\n\t(global = global || self, (global.us = global.us || {}, global.us.test = factory()));\r\n}(this, (function () { 'use strict';\r\n\r\n\t/**\r\n\t * @fileoverview added by tsickle\r\n\t * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\r\n\t */\r\n\tvar index = \"\";\r\n\r\n\treturn index;\r\n\r\n}))); \r\n\u003c/code>\u003c/pre>\r\n\r\nYou'll notice that the factory function has no parameters. When calling ngcc on our library (included in another project), the compiler crashes with the error:\r\n\r\n\u003cpre>\r\nCannot read property 'getEnd' of undefined\r\nat renderFactoryParameters (C:\\Test\\node_modules\\@angular\\compiler-cli\\ngcc\\src\\rendering\\umd_rendering_formatter.js:175:64)\r\n at UmdRenderingFormatter.addImports (C:\\Test\\node_modules\\@angular\\compiler-cli\\ngcc\\src\\rendering\\umd_rendering_formatter.js:50:13)\r\n at Renderer.renderFile (C:\\Test\\node_modules\\@angular\\compiler-cli\\ngcc\\src\\rendering\\renderer.js:91:35)\r\n at C:\\Test\\node_modules\\@angular\\compiler-cli\\ngcc\\src\\rendering\\renderer.js:50:84\r\n...\r\n\u003c/pre>\r\nIt would seem, that renderFactoryParameters has no test for parameters.length being zero.\r\n\r\n## 🌍 Your Environment\r\n\r\n**Angular Version:**\r\n\u003cpre>\u003ccode>\r\nAngular CLI: 9.0.0-rc.4\r\nNode: 10.15.3\r\nOS: win32 x64\r\n\r\nAngular: 9.0.0-rc.4\r\n... animations, cli, common, compiler, compiler-cli, core, forms\r\n... platform-browser, platform-browser-dynamic, router\r\nIvy Workspace: Yes\r\n\r\nPackage Version\r\n------------------------------------------------------------\r\n@angular-devkit/architect 0.900.0-rc.4\r\n@angular-devkit/build-angular 0.900.0-rc.4\r\n@angular-devkit/build-ng-packagr 0.900.0-rc.4\r\n@angular-devkit/build-optimizer 0.900.0-rc.4\r\n@angular-devkit/build-webpack 0.900.0-rc.4\r\n@angular-devkit/core 9.0.0-rc.4\r\n@angular-devkit/schematics 9.0.0-rc.4\r\n@angular/cdk 8.1.2\r\n@angular/http \u003cerror>\r\n@ngtools/webpack 9.0.0-rc.4\r\n@schematics/angular 9.0.0-rc.4\r\n@schematics/update 0.900.0-rc.4\r\nrxjs 6.5.3\r\ntypescript 3.6.4\r\nwebpack 4.41.2\r\n\u003c/code>\u003c/pre>\r\n","author":{"url":"https://github.com/Wintermoose","@type":"Person","name":"Wintermoose"},"datePublished":"2019-11-28T19:26:03Z","url":"https://github.com/angular/angular/issues/34138"}
| 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:4979ed94-f628-4189-18b4-a4e3e2ffd9d3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 87A6:CC1A4:15D5DED:1BC4BCB:6B013118 |
| html-safe-nonce | 35b508eb2fab19e935226171d20849f91cf742c562d29a62a63291d61f564e29 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4N0E2OkNDMUE0OjE1RDVERUQ6MUJDNEJDQjo2QjAxMzExOCIsInZpc2l0b3JfaWQiOiI4MDk0NTY0NDYwNDIyODM2NTA0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 65ca3975eee96c3f109ac9292ea4b03e2e77dfcff85fdb33c7a293b7d9369ded |
| hovercard-subject-tag | issue:530054543 |
| 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/34138/issue_layout |
| twitter:image | https://opengraph.githubassets.com/078d156b70bc5f9ed810f7be3460d21665fedb50ef095f3693aa80b246b55024/angular/angular/issues/34138 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/078d156b70bc5f9ed810f7be3460d21665fedb50ef095f3693aa80b246b55024/angular/angular/issues/34138 |
| og:image:alt | 🐞 bug report Affected Package The issue is caused by package @angular/compiler-cli Is this a regression? Don't know Description As part of our internal library, we have simple module that has no de... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Wintermoose |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width