NativeScript / NativeScript/nativescript-cli
NS 7 with Angular application entry point not being found
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- JavaScript
- Star
- 1.1k
- Fork
- 204
- Merge trung bình
- 1 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 8
Mô tả
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):
✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Xcode is installed and is configured properly.
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ CocoaPods are configured properly.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✔ Xcode version 11.6.0 satisfies minimum required version 10.
✔ Getting NativeScript components versions information...
⚠ Update available for component nativescript. Your current version is 7.0.7-2020-09-09-185920-14263 and the latest available version is 7.0.7.
✔ Component @nativescript/core has 7.0.2 version and is up to date.
✖ Component @nativescript/ios is not installed.
✔ Component @nativescript/android has 7.0.0 version and is up to date.
Describe the bug
After upgrading a code sharing project with Angular to version 7 (using ns migrate) produces a project that results in the following errors being thrown when ns run android is run.
- Web project only HTML files are being flagged as invalid. (It seems these files are being included regardless).
Application entry point file not founderror, even with"main": "main.js"is defined inpackage.jsonornativescript.config.ts
I noticed that during migration, the old tsconfig.tns.json is removed. Without this the project doesn't even start up and notes that a tsconfig file cannot be found. Adding back in my original tsconfig.tns.json file allows the compilation process to start but then throws up the aforementioned errors.
My tsconfig.tns.json
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"module": "esNext",
"target": "es2015",
"moduleResolution": "node",
"skipLibCheck": true,
"resolveJsonModule": true,
"paths": {
// Paths removed for clarity
}
},
"files": ["apps/my-app/src/main.tns.ts"]
}
My nativescript.config.ts
// Identifiable names changed / removed
import { NativeScriptConfig } from '@nativescript/core';
export default {
id: 'com.company.my-app',
appResourcesPath: 'apps/my-app/App_Resources',
android: {
v8Flags: '--expose_gc --harmony_destructuring',
markingMode: 'none',
},
appPath: 'apps/my-app/src',
main: 'main.js',
nsext: '.tns',
webext: '',
shared: true,
useLegacyWorkflow: false,
webpackConfigPath: './webpack.config.tns.js',
} as NativeScriptConfig;
It is worth noting that this project is included within a @nrwl/nx workspace and was working perfectly prior to the upgrade process.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với hành vi migration xung quanh tsconfig.tns.json và các thiết lập entry point trong nativescript.config.ts, sau đó kiểm tra webpack.config.tns.js và tái hiện bằng ns migrate, tiếp theo là ns run android. Công việc được xem là hoàn tất khi dự án Angular code-sharing đã migrate có thể biên dịch và chạy mà không gặp lỗi HTML không hợp lệ hoặc thiếu application entry point.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- angular, javascript, typescript
- Lĩnh vực
- build-system, cli, mobile-dev
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 25/100