Title: [Reproducible] Can't resolve tilde ("~") included path · Issue #298 · NativeScript/nativescript-dev-webpack · GitHub
Open Graph Title: [Reproducible] Can't resolve tilde ("~") included path · Issue #298 · NativeScript/nativescript-dev-webpack
X Title: [Reproducible] Can't resolve tilde ("~") included path · Issue #298 · NativeScript/nativescript-dev-webpack
Description: Create an app by tns create MY_PROJECT --template tns-template-hello-world-ng, setup nativescript-dev-webpack, and simply change this line from import { ItemsComponent } from "./item/items.component"; to import { ItemsComponent } from "~...
Open Graph Description: Create an app by tns create MY_PROJECT --template tns-template-hello-world-ng, setup nativescript-dev-webpack, and simply change this line from import { ItemsComponent } from "./item/items.componen...
X Description: Create an app by tns create MY_PROJECT --template tns-template-hello-world-ng, setup nativescript-dev-webpack, and simply change this line from import { ItemsComponent } from "./item/items.com...
Opengraph URL: https://github.com/NativeScript/nativescript-dev-webpack/issues/298
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Reproducible] Can't resolve tilde (\"~\") included path","articleBody":"Create an app by `tns create MY_PROJECT --template tns-template-hello-world-ng`, setup `nativescript-dev-webpack`, and simply change [this line](https://github.com/NativeScript/template-hello-world-ng/blob/master/app.routing.ts#L5) from \r\n\r\n```\r\nimport { ItemsComponent } from \"./item/items.component\";\r\n```\r\n\r\nto \r\n\r\n```\r\nimport { ItemsComponent } from \"~/item/items.component\";\r\n```\r\n\r\nand run `npm run start-android-bundle`, then get the following error.\r\n\r\n```\r\nERROR in Error encountered resolving symbol values statically. \r\n\r\nCould not resolve ~/item/items.component relative to /MY_PROJECT/app/app.routing.ts., \r\nresolving symbol AppRoutingModule in /MY_PROJECT/app/app.routing.ts,\r\nresolving symbol AppRoutingModule in /MY_PROJECT/app/app.routing.ts,\r\nresolving symbol AppRoutingModule in /MY_PROJECT/app/app.routing.ts\r\n\r\n\r\nERROR in ./main.aot.ts\r\nModule not found: Error: Can't resolve './app.module.ngfactory' in '/MY_PROJECT/app'\r\n @ ./main.aot.ts 5:29-62\r\n```\r\n\r\nThe same code builds and works successfully when running `tns run android`, so guess it's webpack's problem?\r\n\r\nHere's the relative looking infos\r\n\r\npackage.json\r\n```\r\n \"nativescript\": {\r\n \"tns-android\": {\r\n \"version\": \"3.2.0\"\r\n }\r\n },\r\n \"dependencies\": {\r\n \"@angular/animations\": \"~4.4.1\",\r\n \"@angular/common\": \"~4.4.1\",\r\n \"@angular/compiler\": \"~4.4.1\",\r\n \"@angular/core\": \"~4.4.1\",\r\n \"@angular/forms\": \"~4.4.1\",\r\n \"@angular/http\": \"~4.4.1\",\r\n \"@angular/platform-browser\": \"~4.4.1\",\r\n \"@angular/router\": \"~4.4.1\",\r\n \"nativescript-angular\": \"~4.4.1\",\r\n ....\r\n},\r\n \"devDependencies\": {\r\n \"@angular/compiler-cli\": \"~4.4.1\",\r\n \"@ngtools/webpack\": \"~1.6.0\",\r\n \"babel-traverse\": \"6.26.0\",\r\n \"babel-types\": \"6.26.0\",\r\n \"babylon\": \"6.18.0\",\r\n \"copy-webpack-plugin\": \"~4.0.1\",\r\n \"extract-text-webpack-plugin\": \"~3.0.0\",\r\n \"lazy\": \"1.0.11\",\r\n \"nativescript-css-loader\": \"~0.26.0\",\r\n \"nativescript-dev-typescript\": \"~0.5.0\",\r\n \"nativescript-dev-webpack\": \"^0.8.0\",\r\n \"nativescript-worker-loader\": \"~0.8.1\",\r\n \"raw-loader\": \"~0.5.1\",\r\n \"resolve-url-loader\": \"~2.1.0\",\r\n \"typescript\": \"~2.4.2\",\r\n \"webpack\": \"~3.2.0\",\r\n \"webpack-bundle-analyzer\": \"^2.8.2\",\r\n \"webpack-sources\": \"~1.0.1\"\r\n },\r\n\r\n```\r\n\r\ntsconfig.json\r\n```\r\n{\r\n \"compilerOptions\": {\r\n ...\r\n \"paths\": {\r\n \"~/*\": [ \"./app/*\" ],\r\n \"*\": [\r\n \"./node_modules/tns-core-modules/*\",\r\n \"./node_modules/*\"\r\n ]\r\n }\r\n ...\r\n```\r\n\r\nwebpack.config.js\r\n```\r\n ...\r\n resolve: {\r\n ...\r\n alias: {\r\n '~': resolve(\"./app\")\r\n },\r\n }\r\n ...\r\n```\r\nAnybody knows why?","author":{"url":"https://github.com/Liooo","@type":"Person","name":"Liooo"},"datePublished":"2017-10-20T09:20:00Z","url":"https://github.com/NativeScript/nativescript-dev-webpack/issues/298"}
| 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:b5872106-888b-7b71-1f7b-1b3cc01839aa |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9B0E:269AD9:1BDE46F:253091E:6B01613C |
| html-safe-nonce | fa69d18c60460c381dcc48fd85eb66658fced80c78950b5ed42bcf83559b0280 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QjBFOjI2OUFEOToxQkRFNDZGOjI1MzA5MUU6NkIwMTYxM0MiLCJ2aXNpdG9yX2lkIjoiNDA4MTc4Nzc5ODY0OTEzNTQyMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 96819bb6f89ce7ba93f8b61cfe3b1fc9978565649edfeb3af0b1a334240ff001 |
| hovercard-subject-tag | issue:267113635 |
| 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-dev-webpack/298/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2f3c6799b9b896ed2976d8db4c80fb5b9624ae123f34e02c258a0dbc573c380e/NativeScript/nativescript-dev-webpack/issues/298 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2f3c6799b9b896ed2976d8db4c80fb5b9624ae123f34e02c258a0dbc573c380e/NativeScript/nativescript-dev-webpack/issues/298 |
| og:image:alt | Create an app by tns create MY_PROJECT --template tns-template-hello-world-ng, setup nativescript-dev-webpack, and simply change this line from import { ItemsComponent } from "./item/items.componen... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Liooo |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/NativeScript/nativescript-dev-webpack git https://github.com/NativeScript/nativescript-dev-webpack.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 54984270 |
| octolytics-dimension-repository_nwo | NativeScript/nativescript-dev-webpack |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 54984270 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/nativescript-dev-webpack |
| 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