Title: Cannot link tns-core-modules in Angular app · Issue #7905 · NativeScript/NativeScript · GitHub
Open Graph Title: Cannot link tns-core-modules in Angular app · Issue #7905 · NativeScript/NativeScript
X Title: Cannot link tns-core-modules in Angular app · Issue #7905 · NativeScript/NativeScript
Description: Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project): CLI: 6.1.2 Cross-platform modules: 6.1.1 Android...
Open Graph Description: Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project): CLI: 6.1...
X Description: Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project): CLI: 6.1...
Opengraph URL: https://github.com/NativeScript/NativeScript/issues/7905
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Cannot link tns-core-modules in Angular app","articleBody":"**Environment**\r\nProvide version numbers for the following components (information can be retrieved by running `tns info` in your project folder or by inspecting the `package.json` of the project):\r\n - CLI: 6.1.2\r\n - Cross-platform modules: 6.1.1\r\n - Android Runtime: 6.1.2\r\n - iOS Runtime: 6.1.1\r\n\r\n**Describe the bug**\r\nWhen trying to contribute to `tns-core-modules` and using an external NS Angular app to develop / test these contributions, the compile step fails when following the instructions currently outlined in [DevelopmentWorkflow.md](https://github.com/NativeScript/NativeScript/blob/master/DevelopmentWorkflow.md#running-another-app) (Running Another App).\r\n\r\n**To Reproduce**\r\n``` bash\r\ngit clone git@github.com:NativeScript/NativeScript.git\r\ncd NativeScript\r\ntns create blank-ng --template tns-template-blank-ng\r\ncd blank ng\r\nnpm install ../tns-core-modules --save\r\ntns run ios # or tns run android\r\n```\r\n\r\n**Expected behavior**\r\nApplication should run successfully but instead generates the following log https://gist.github.com/rynop/5156d00932b17937cc8889f2a0581f03\r\n\r\n**Additional context**\r\n@bundyo discovered a [workaround](https://github.com/NativeScript/nativescript-dev-webpack/issues/1044#issuecomment-533397897):\r\n\r\n\u003e The problem with linking is that Angular/TS project tend to grab the linked TS files in core modules and try to compile them without the references needed. I've only managed to run it by compiling the core modules with outDir and linking that (.d.ts, package.json and other files, except TS ones should be copied over too). Maybe the team can consider moving to an outDir compilation. Another way would be dev-webpack to forbid Angular/ts-loader for traversing node_modules.\r\n\r\nBut as noted by @MartoYankov [here](https://github.com/NativeScript/NativeScript/pull/7861#issuecomment-535801655):\r\n\u003e @bundyo I followed the steps from \"running another app\" plus one additional step - adding the `tns-platform-declarations` packages to the app. The errors that the ng compiler producers are with types and exports. I suspect these still happen in the regular `ts-loader`, but as warnings. The ng compiler is producing them as errors.\r\n\u003e \r\n\u003e The reason why we don't want to promote alternative dev setups is because we can't support them. We adhere to the dev setup in the nativescript plugin seed to make sure the `tns-core-modules` have a similar setup to all plugins. What I mean is, we should fix the current setup or if not possible - change the dev setup in the plugin seed first.\r\n\r\nSo addressing this issue is two-fold:\r\n- Update dev workflow to require `tns-platform-declarations` as a dev dependency in the Angular app in this scenario (alongside with a references.d.ts in the app root)\r\n- Address the remaining errors that the Angular compiler produces with types and exports\r\n\r\n","author":{"url":"https://github.com/manoldonev","@type":"Person","name":"manoldonev"},"datePublished":"2019-10-04T14:57:50.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/7905/NativeScript/issues/7905"}
| 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:2f06f6e9-6b0d-e2c8-8fde-d0b2a8edf010 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9F26:14C87:273B613:3265774:697491CD |
| html-safe-nonce | a0fa29d0a0d3c19dade07f7bc702462fac06d24d1694210a78492ae55b71fb96 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RjI2OjE0Qzg3OjI3M0I2MTM6MzI2NTc3NDo2OTc0OTFDRCIsInZpc2l0b3JfaWQiOiI3NzM0NDMwMTcyNzI2OTg5MjYxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 45f8c0289bace039090a537533cf4241a70d743018ffcbad94d65dfe3a5a9a97 |
| hovercard-subject-tag | issue:502685517 |
| 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/NativeScript/NativeScript/7905/issue_layout |
| twitter:image | https://opengraph.githubassets.com/96a2c3da66d3f1c90c1c7ec0a048b81712f66712d329355e59b0ab0b15986153/NativeScript/NativeScript/issues/7905 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/96a2c3da66d3f1c90c1c7ec0a048b81712f66712d329355e59b0ab0b15986153/NativeScript/NativeScript/issues/7905 |
| og:image:alt | Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project): CLI: 6.1... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | manoldonev |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4a4bf5f4e28041a9d2e5c107d7d20b78b4294ba261cab243b28167c16a623a1f |
| turbo-cache-control | no-preview |
| go-import | github.com/NativeScript/NativeScript git https://github.com/NativeScript/NativeScript.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 31492490 |
| octolytics-dimension-repository_nwo | NativeScript/NativeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31492490 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/NativeScript |
| 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 | 488b30e96dfd057fbbe44c6665ccbc030b729dde |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width