Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 7, 2021. It is now read-only.
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

[Reproducible] Can't resolve tilde ("~") included path #298

Open
@Liooo

Description

@Liooo

Create an app bytns create MY_PROJECT --template tns-template-hello-world-ng, setupnativescript-dev-webpack, and simply changethis line from

import { ItemsComponent } from "./item/items.component";

to

import { ItemsComponent } from "~/item/items.component";

and runnpm run start-android-bundle, then get the following error.

ERROR in Error encountered resolving symbol values statically. Could not resolve ~/item/items.component relative to /MY_PROJECT/app/app.routing.ts., resolving symbol AppRoutingModule in /MY_PROJECT/app/app.routing.ts,resolving symbol AppRoutingModule in /MY_PROJECT/app/app.routing.ts,resolving symbol AppRoutingModule in /MY_PROJECT/app/app.routing.tsERROR in ./main.aot.tsModule not found: Error: Can't resolve './app.module.ngfactory' in '/MY_PROJECT/app' @ ./main.aot.ts 5:29-62

The same code builds and works successfully when runningtns run android, so guess it's webpack's problem?

Here's the relative looking infos

package.json

  "nativescript": {    "tns-android": {      "version": "3.2.0"    }  },  "dependencies": {    "@angular/animations": "~4.4.1",    "@angular/common": "~4.4.1",    "@angular/compiler": "~4.4.1",    "@angular/core": "~4.4.1",    "@angular/forms": "~4.4.1",    "@angular/http": "~4.4.1",    "@angular/platform-browser": "~4.4.1",    "@angular/router": "~4.4.1",    "nativescript-angular": "~4.4.1",    ....},  "devDependencies": {    "@angular/compiler-cli": "~4.4.1",    "@ngtools/webpack": "~1.6.0",    "babel-traverse": "6.26.0",    "babel-types": "6.26.0",    "babylon": "6.18.0",    "copy-webpack-plugin": "~4.0.1",    "extract-text-webpack-plugin": "~3.0.0",    "lazy": "1.0.11",    "nativescript-css-loader": "~0.26.0",    "nativescript-dev-typescript": "~0.5.0",    "nativescript-dev-webpack": "^0.8.0",    "nativescript-worker-loader": "~0.8.1",    "raw-loader": "~0.5.1",    "resolve-url-loader": "~2.1.0",    "typescript": "~2.4.2",    "webpack": "~3.2.0",    "webpack-bundle-analyzer": "^2.8.2",    "webpack-sources": "~1.0.1"  },

tsconfig.json

{    "compilerOptions": {       ...        "paths": {            "~/*": [ "./app/*" ],            "*": [                "./node_modules/tns-core-modules/*",                "./node_modules/*"            ]        }      ...

webpack.config.js

        ...        resolve: {           ...            alias: {                '~': resolve("./app")            },        }       ...

Anybody knows why?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp