Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Application entry point file not found using --bundle #588

Closed
10 tasks done
jgerryl opened this issue Jun 27, 2018 · 13 comments
Closed
10 tasks done

Application entry point file not found using --bundle #588

jgerryl opened this issue Jun 27, 2018 · 13 comments

Comments

@jgerryl
Copy link

jgerryl commented Jun 27, 2018

Issue Checklist

Tell us about the problem

I'm trying to use nativescript-dev-webpack. i run tns build android --bundle successfully but then got error when using tns run android --bundle. I'm using custom main activity and it works fine. unfortunately it app size is too big. I'm following issue #559 but still got another error "application entry point file not found. please specify the file in package.json otherwise make sure the file index.js or bootstrap.js exists." I check my app/package.json in app folder said main : main.js and i check main.js exists.

error

System.err: java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Application entry point file not found. Please specify the file in package.json otherwise make sure the file index.js or bootstrap.js exists.\nIf using typescript make sure your entry point file is transpiled to javascript.
System.err:     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4710)
System.err:     at android.app.ActivityThread.-wrap1(ActivityThread.java)
System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
System.err:     at android.os.Handler.dispatchMessage(Handler.java:102)
System.err:     at android.os.Looper.loop(Looper.java:148)
System.err:     at android.app.ActivityThread.main(ActivityThread.java:5417)
System.err:     at java.lang.reflect.Method.invoke(Native Method)
System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
System.err: Caused by: com.tns.NativeScriptException: Application entry point file not found. Please specify the file in package.json otherwise make sure the file index.js or bootstrap.js exists.\nIf using typescript make sure your entry point file is transpiled to javascript.
System.err:     at com.tns.Module.bootstrapApp(Module.java:311)
System.err:     at com.tns.Runtime.run(Runtime.java:533)
System.err:     at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
System.err:     at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1013)
System.err:     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4707)
System.err:     ... 8 more
System.err: Caused by: com.tns.NativeScriptException: Failed to find module: "./", relative to: app//
System.err:     at com.tns.Module.resolvePathHelper(Module.java:146)
System.err:     at com.tns.Module.bootstrapApp(Module.java:309)
System.err:     ... 12 more

Local environment

  • Platform : Windows
  • Node version v8.11.3
  • NativeScript CLI version 4.1.1

Project data

  • Platform you are building the app for Android
  • Node dependencies:
{
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "NativeScript Application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "com.myapp.xx",
    "tns-android": {
      "version": "4.1.3"
    }
  },
  "dependencies": {
    "@angular/animations": "~6.0.6",
    "@angular/common": "~6.0.6",
    "@angular/compiler": "~6.0.6",
    "@angular/core": "~6.0.6",
    "@angular/forms": "~6.0.6",
    "@angular/http": "~6.0.6",
    "@angular/platform-browser": "~6.0.6",
    "@angular/platform-browser-dynamic": "~6.0.6",
    "@angular/router": "~6.0.6",
    "awesome-typescript-loader": "^5.2.0",
    "nativescript-angular": "^6.0.0",
    "nativescript-background-http": "^3.2.7",
    "nativescript-camera": "^4.0.2",
    "nativescript-feedback": "^1.2.0",
    "nativescript-local-notifications": "^2.0.4",
    "nativescript-mediafilepicker": "^1.0.7",
    "nativescript-push-notifications": "^1.1.4",
    "nativescript-theme-core": "^1.0.4",
    "nativescript-ui-dataform": "^3.6.1",
    "nativescript-ui-listview": "^3.5.8",
    "reflect-metadata": "~0.1.8",
    "rxjs": "~6.2.1",
    "tns-core-modules": "^4.1.0",
    "tns-platform-declarations": "^4.0.0",
    "zone.js": "~0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.7.0-rc.0",
    "@angular/compiler-cli": "~6.1.0-beta.1",
    "angular-router-loader": "^0.8.5",
    "babel-traverse": "^6.26.0",
    "babel-types": "^6.26.0",
    "babylon": "6.4.5",
    "lazy": "1.0.11",
    "nativescript-dev-typescript": "^0.7.1",
    "nativescript-dev-webpack": "^0.14.1",
    "typescript": "^2.7.2",
    "webpack": "^4.12.1"
  }
}

  • Webpack configuration:
const { join, relative, resolve, sep } = require("path");

const webpack = require("webpack");
const nsWebpack = require("nativescript-dev-webpack");
const nativescriptTarget = require("nativescript-dev-webpack/nativescript-target");
const { PlatformReplacementHost } = require("nativescript-dev-webpack/host/platform");
const CleanWebpackPlugin = require("clean-webpack-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const { AngularCompilerPlugin } = require("@ngtools/webpack");

module.exports = env => {
    // Add your custom Activities, Services and other Android app components here.
    const appComponents = [
        "tns-core-modules/ui/frame",
        "tns-core-modules/ui/frame/activity",
        //"./app/activity.android.ts",
        resolve(__dirname, "app/activity.android.ts"),
    ];

    const platform = env && (env.android && "android" || env.ios && "ios");
    if (!platform) {
        throw new Error("You need to provide a target platform!");
    }

    const extensions = ["tns", platform];
    const platformHost = new PlatformReplacementHost(extensions);

    const projectRoot = __dirname;

    // Default destination inside platforms/<platform>/...
    const dist = resolve(projectRoot, nsWebpack.getAppPath(platform, projectRoot));
    const appResourcesPlatformDir = platform === "android" ? "Android" : "iOS";

    const {
        // The 'appPath' and 'appResourcesPath' values are fetched from
        // the nsconfig.json configuration file
        // when bundling with `tns run android|ios --bundle`.
        appPath = "app",
        appResourcesPath = "app/App_Resources",

        // You can provide the following flags when running 'tns run android|ios'
        aot, // --env.aot
        snapshot, // --env.snapshot
        uglify, // --env.uglify
        report, // --env.report
    } = env;

    const appFullPath = resolve(projectRoot, appPath);
    const appResourcesFullPath = resolve(projectRoot, appResourcesPath);

    const entryModule = aot ?
        nsWebpack.getAotEntryModule(appFullPath) : 
        `${nsWebpack.getEntryModule(appFullPath)}.ts`;
    const entryPath = `.${sep}${entryModule}`;

    const config = {
        mode: uglify ? "production" : "development",
        context: appFullPath,
        watchOptions: {
            ignored: [
                appResourcesFullPath,
                // Don't watch hidden files
                "**/.*",
            ]
        },
        target: nativescriptTarget,
        entry: {
            bundle: entryPath,
            application: "./activity.android",
        },
        output: {
            pathinfo: false,
            path: dist,
            libraryTarget: "commonjs2",
            filename: "[name].js",
            globalObject: "global",
        },
        resolve: {
            extensions: [".ts", ".js", ".scss", ".css"],
            // Resolve {N} system modules from tns-core-modules
            modules: [
                resolve(__dirname, "node_modules/tns-core-modules"),
                resolve(__dirname, "node_modules"),
                "node_modules/tns-core-modules",
                "node_modules",
            ],
            alias: {
                '~': appFullPath
            },
            symlinks: true
        },
        resolveLoader: {
            symlinks: false
        },
        node: {
            // Disable node shims that conflict with NativeScript
            "http": false,
            "timers": false,
            "setImmediate": false,
            "fs": "empty",
            "__dirname": false,
        },
        devtool: "none",
        optimization: {
            splitChunks: {
                cacheGroups: {
                    vendor: {
                        name: "vendor",
                        chunks: "all",
                        test: (module, chunks) => {
                            const moduleName = module.nameForCondition ? module.nameForCondition() : '';
                            return /[\\/]node_modules[\\/]/.test(moduleName) ||
                                    appComponents.some(comp => comp === moduleName);
                        },
                        enforce: true,
                    },
                }
            },
            minimize: !!uglify,
            minimizer: [
                new UglifyJsPlugin({
                    uglifyOptions: {
                        parallel: true,
                        cache: true,
                        output: {
                            comments: false,
                        },
                        compress: {
                            // The Android SBG has problems parsing the output
                            // when these options are enabled
                            'collapse_vars': platform !== "android",
                            sequences: platform !== "android",
                        }
                    }
                })
            ],
        },
        module: {
            rules: [
                {
                    test: new RegExp(entryPath),
                    use: [
                        // Require all Android app components
                        platform === "android" && {
                            loader: "nativescript-dev-webpack/android-app-components-loader",
                            options: { modules: appComponents }
                        },

                        {
                            loader: "nativescript-dev-webpack/bundle-config-loader",
                            options: {
                                angular: true,
                                loadCss: !snapshot, // load the application css if in debug mode
                            }
                        },
                    ].filter(loader => !!loader)
                },

                { test: /\.html$|\.xml$/, use: "raw-loader" },

                // tns-core-modules reads the app.css and its imports using css-loader
                {
                    test: /[\/|\\]app\.css$/,
                    use: {
                        loader: "css-loader",
                        options: { minimize: false, url: false },
                    }
                },
                {
                    test: /[\/|\\]app\.scss$/,
                    use: [
                        { loader: "css-loader", options: { minimize: false, url: false } },
                        "sass-loader"
                    ]
                },
                {
                    test: /\.ts$/,
                    loaders: 'awesome-typescript-loader',
                    options: {
                        useCache: true,
                        forceIsolatedModules: true
                    }
                  },
                  {
                    test: /\.(ts|js)$/,
                    loaders: [
                      'angular-router-loader'
                    ]
                  },

                // Angular components reference css files and their imports using raw-loader
                { test: /\.css$/, exclude: /[\/|\\]app\.css$/, use: "raw-loader" },
                { test: /\.scss$/, exclude: /[\/|\\]app\.scss$/, use: ["raw-loader", "resolve-url-loader", "sass-loader"] },

                // Compile TypeScript files with ahead-of-time compiler.
                {
                    test: /.ts$/, use: [
                        "nativescript-dev-webpack/moduleid-compat-loader",
                        "@ngtools/webpack",
                    ]
                },

                // Mark files inside `@angular/core` as using SystemJS style dynamic imports.
                // Removing this will cause deprecation warnings to appear.
                {
                    test: /[\/\\]@angular[\/\\]core[\/\\].+\.js$/,
                    parser: { system: true },
                },
            ],
        },
        plugins: [
            // Define useful constants like TNS_WEBPACK
            new webpack.DefinePlugin({
                "global.TNS_WEBPACK": "true",
            }),
            // Remove all files from the out dir.
            new CleanWebpackPlugin([ `${dist}/**/*` ]),
            // Copy native app resources to out dir.
            new CopyWebpackPlugin([
                {
                    from: `${appResourcesFullPath}/${appResourcesPlatformDir}`,
                    to: `${dist}/App_Resources/${appResourcesPlatformDir}`,
                    context: projectRoot
                },
            ]),
            // Copy assets to out dir. Add your own globs as needed.
            new CopyWebpackPlugin([
                { from: "fonts/**" },
                { from: "**/*.jpg" },
                { from: "**/*.png" },
            ], { ignore: [`${relative(appPath, appResourcesFullPath)}/**`] }),
            // Generate a bundle starter script and activate it in package.json
            new nsWebpack.GenerateBundleStarterPlugin([
                "./vendor",
                "./bundle",
            ]),
            // For instructions on how to set up workers with webpack
            // check out https://github.com/nativescript/worker-loader
            new NativeScriptWorkerPlugin(),

            new AngularCompilerPlugin({
                host: platformHost,
                entryModule: resolve(appPath, "app.module#AppModule"),
                tsConfigPath: join(__dirname, "tsconfig.esm.json"),
                skipCodeGeneration: !aot,
            }),
            // Does IPC communication with the {N} CLI to notify events when running in watch mode.
            new nsWebpack.WatchStateLoggerPlugin(),
        ],
    };

    if (report) {
        // Generate report files for bundles content
        config.plugins.push(new BundleAnalyzerPlugin({
            analyzerMode: "static",
            openAnalyzer: false,
            generateStatsFile: true,
            reportFilename: resolve(projectRoot, "report", `report.html`),
            statsFilename: resolve(projectRoot, "report", `stats.json`),
        }));
    }

    if (snapshot) {
        config.plugins.push(new nsWebpack.NativeScriptSnapshotPlugin({
            chunk: "vendor",
            angular: true,
            requireModules: [
                "reflect-metadata",
                "@angular/platform-browser",
                "@angular/core",
                "@angular/common",
                "@angular/router",
                "nativescript-angular/platform-static",
                "nativescript-angular/router",
            ],
            projectRoot,
            webpackConfig: config,
        }));
    }

    return config;
};

  • ts.config:
{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es5",
        "experimentalDecorators": true,
        "emitDecoratorMetadata": true,
        "noEmitHelpers": true,
        "noEmitOnError": true,
        "lib": [
            "es6",
            "dom",
            "es2015.iterable"
        ],
        "baseUrl": ".",
        "paths": {
            "~/*": [
                "app/*"
            ],
            "*": [
                "./node_modules/tns-core-modules/*",
                "./node_modules/*"
            ]
        }
    },
    "files": [
        "./app/delegate.ios.ts",
        "./app/activity.android.ts",
        "./app/main.ts"
    ],
    "exclude": [
        "node_modules",
        "platforms"
    ]
}
@NickIliev
Copy link
Contributor

@jgerryl the error application entry point file not found is often related to the fact that the source JS files are not present in the build application (in /platform/android/app/src/main/assets/app). This might happen due to a number of reasons. My suggestion is to try a clean rebuild.

rm -rf node_modules platforms hooks
// also remove webpack.config.js but do not forget to add the extended activity later in the newly generated one
npm i
// perhaps add the extended activity in the generated webpack.config.js
tns platform add android
tns build android
tns run android --bundle

@NickIliev
Copy link
Contributor

NickIliev commented Jun 27, 2018

@jgerryl another thing we noticed is that you are setting the extended activity as application entry

 entry: {
    bundle: entryPath,
    application: "./activity.android", // why the extended activity is given as appliction entry
},

Remove the line application: "./activity.android", unless you are not extending the application.

 entry: {
    bundle: entryPath,
},

Details here

@jgerryl
Copy link
Author

jgerryl commented Jun 28, 2018

Hi @NickIliev thanks for your response, already done it but it gives another error. I'm using lazy load so need to install awesome-typescript-loader and angular-router-loader as you can see in my webpack.config.js.

when i click a button

JS: ERROR Error: Uncaught (in promise): Object: {"loadChunkError":true,"details":{"originalStack":"Error: Module build failed (from ../node_modules/@ngtools/webpack/src/index.js):\nError: C:\\Users\\admin\\Documents\\Native\\myApp\\app\\home\\home.module.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.\n    at AngularCompilerPlugin.getCompiledFile (C:\\Users\\admin\\Documents\\Native\\myApp\\node_modules\\@ngtools\\webpack\\src\\packages\\ngtools\\webpack\\src\\angular_compiler_plugin.ts:951:15)\n    at plugin.done.then (C:\\Users\\admin\\Documents\\Native\\myApp\\node_modules\\@ngtools\\webpack\\src\\packages\\ngtools\\webpack\\src\\loader.ts:49:29)\n    at <anonymous>\n    at process._tickCallback (internal/process/next_tick.js:188:7)\n    at new ZoneAwareError (file:///data/data/com.myapp.id/files/app/vendor.js:69743:33)\n    at Object../home/home.module.ts (file:///data/data/com.myapp.id/files/app/0.js:6:7)\n    at...
JS: ERROR Error: Uncaught (in promise): Error: No NgModule metadata found for 'undefined'.
JS: Error: No NgModule metadata found for 'undefined'.
JS:     at NgModuleResolver.push.../node_modules/@angular/compiler/fesm5/compiler.js.NgModuleResolver.resolve (file:///data/data/com.myapp.id/files/app/vendor.js:19642:23) [angular]
JS:     at CompileMetadataResolver.push.../node_modules/@angular/compiler/fesm5/compiler.js.CompileMetadataResolver.getNgModuleMetadata (file:///data/data/com.myapp.id/files/app/vendor.js:18279:43) [angular]
JS:     at JitCompiler.push.../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._loadModules (file:///data/data/com.myapp.id/files/app/vendor.js:30417:51) [angular]
JS:     at JitCompiler.push.../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._compileModuleAndComponents (file:///data/data/com.myapp.id/files/app/vendor.js:30398:36) [angular]
JS:     at JitCompiler.push.../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler.compileModuleAsync (file:///data/data/com.myapp...

error when tns run android --bundle

Unable to instantiate Activity ComponentInfo{com.myApp.id/com.kre.NativeScriptActivity}: com.tns.NativeScriptException: Failed to create Java Script extend wrapper for class 'com/kre/NativeScriptActivity'

ERROR in ./home/home.module.ts
Module build failed (from ../node_modules/@ngtools/webpack/src/index.js):
Error: C:\Users\admin\Documents\Native\myApp\app\home\home.module.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
    at AngularCompilerPlugin.getCompiledFile (C:\Users\admin\Documents\Native\myApp\node_modules\@ngtools\webpack\src\packages\ngtools\webpack\src\angular_compiler_plugin.ts:951:15)
    at plugin.done.then (C:\Users\admin\Documents\Native\myApp\node_modules\@ngtools\webpack\src\packages\ngtools\webpack\src\loader.ts:49:29)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
 @ ./app.routing.ts 13:132-163
 @ ./app.module.ts
 @ ./main.ts

ERROR in ./register/register.module.ts
Module build failed (from ../node_modules/@ngtools/webpack/src/index.js):
Error: C:\Users\admin\Documents\Native\myApp\app\register\register.module.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
    at AngularCompilerPlugin.getCompiledFile (C:\Users\admin\Documents\Native\myApp\node_modules\@ngtools\webpack\src\packages\ngtools\webpack\src\angular_compiler_plugin.ts:951:15)
    at plugin.done.then (C:\Users\admin\Documents\Native\myApp\node_modules\@ngtools\webpack\src\packages\ngtools\webpack\src\loader.ts:49:29)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
 @ ./app.routing.ts 17:132-171
 @ ./app.module.ts
 @ ./main.ts

ERROR in ./sub-setting/sub-setting.module.ts
Module build failed (from ../node_modules/@ngtools/webpack/src/index.js):
Error: C:\Users\admin\Documents\Native\myApp\app\sub-setting\sub-setting.module.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
    at AngularCompilerPlugin.getCompiledFile (C:\Users\admin\Documents\Native\myApp\node_modules\@ngtools\webpack\src\packages\ngtools\webpack\src\angular_compiler_plugin.ts:951:15)
    at plugin.done.then (C:\Users\admin\Documents\Native\myApp\node_modules\@ngtools\webpack\src\packages\ngtools\webpack\src\loader.ts:49:29)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
 @ ./app.routing.ts 24:132-177
 @ ./app.module.ts
 @ ./main.ts

ERROR in [at-loader] ./app/activity.android.ts:15:77
    TS2445: Property 'onCreate' is protected and only accessible within class 'Activity' and its subclasses.

ERROR in [at-loader] ./app/activity.android.ts:20:78
    TS2445: Property 'onSaveInstanceState' is protected and only accessible within class 'Activity' and its subclasses.

ERROR in [at-loader] ./app/activity.android.ts:23:56
    TS2445: Property 'onStart' is protected and only accessible within class 'Activity' and its subclasses.

ERROR in [at-loader] ./app/activity.android.ts:26:55
    TS2445: Property 'onStop' is protected and only accessible within class 'Activity' and its subclasses.

and bunch of error like

ERROR in [at-loader] ./app/delegate.ios.ts:5:5
    TS2304: Cannot find name '__extends'.

ERROR in [at-loader] ./app/delegate.ios.ts:24:23
    TS2339: Property 'ObjCProtocols' does not exist on type '() => any'.

ERROR in [at-loader] ./app/shared/backend.service.ts:6:20
    TS2339: Property 'isLoggedIn' does not exist on type '() => void'.

ERROR in [at-loader] ./app/shared/backend.service.ts:263:20
    TS2339: Property 'baseUrl' does not exist on type '() => void'.

ERROR in [at-loader] ./app/shared/backend.service.ts:264:20
    TS2339: Property 'appUserHeader' does not exist on type '() => void'.

ERROR in [at-loader] ./app/shared/backend.service.ts:265:20
    TS2339: Property 'apiUrl' does not exist on type '() => void'.

I try this in ts.config file but still got the same error

    "files": [
        "./app/delegate.ios.ts",
        "./app/activity.android.ts",
        "./app/main.ts",
        "./app/register/register.module.ts",
        "./app/home/home.module.ts",
        "./app/sub-setting/sub-setting.module"
    ],

And i do this to app.module.ts

import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
import { NativeScriptRouterModule } from "nativescript-angular/router";
....
...
providers: [
        BackendService,
        LoginService,
        authProvider,
        ModalDialogService,
        AlertService,
        NotificationService,
        {provide: NgModule, useClass: NativeScriptRouterModule } <----- i add this base on [https://github.com/NativeScript/NativeScript/issues/4630](https://github.com/NativeScript/NativeScript/issues/4630)
    ],

should i open new issue on this?

@jgerryl jgerryl changed the title Application entry point file not found using --bundle Application entry point file not found using --bundle & lazy load compatible Jun 28, 2018
@jgerryl jgerryl changed the title Application entry point file not found using --bundle & lazy load compatible Application entry point file not found using --bundle Jun 28, 2018
@jgerryl
Copy link
Author

jgerryl commented Jun 28, 2018

Just want to share i solve error Module build failed and error when click a button by changing tsconfig.json and add include property and change files property like this

"include": [
    "./app/*.ts",
    "./app/**/*.ts"
],
"files": [
        "./app/delegate.ios.ts",
        "./app/activity.android.ts",
        "./app/main.ts"
    ],

so the remain errors are [at-loader] and Unable to instantiate Activity ComponentInfo{com.myApp.id/com.kre.NativeScriptActivity}: com.tns.NativeScriptException: Failed to create Java Script extend wrapper for class 'com/kre/NativeScriptActivity'.

Anyone have a suggestions? Because when i use tns run android --bundle --env.uglify it stopped.

Thanks

@andreaskarlssondev
Copy link

+1

@NickIliev
Copy link
Contributor

@jgerryl not exactly sure which of the errors you have encoutered are resolved - can you clarify the case and also test by updating to [email protected] and following the updated instructions and examples as done here

@jgerryl
Copy link
Author

jgerryl commented Jul 3, 2018

@NickIliev i already tried couple times from the link you gave still no good result. I already update to [email protected] too. But i still get protected OnStart and other. Guess this is the problem of TypeScript.. Do i need to update TypeScript to 2.9.2? But if i update some angular cli or any other angular cannot use TS 2.9.2

Only this issue is resolved by using include

ERROR in ./home/home.module.ts
Module build failed (from ../node_modules/@ngtools/webpack/src/index.js):
Error: C:\Users\admin\Documents\Native\myApp\app\home\home.module.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
    at AngularCompilerPlugin.getCompiledFile (C:\Users\admin\Documents\Native\myApp\node_modules\@ngtools\webpack\src\packages\ngtools\webpack\src\angular_compiler_plugin.ts:951:15)
    at plugin.done.then (C:\Users\admin\Documents\Native\myApp\node_modules\@ngtools\webpack\src\packages\ngtools\webpack\src\loader.ts:49:29)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
 @ ./app.routing.ts 13:132-163
 @ ./app.module.ts
 @ ./main.ts

ERROR in ./register/register.module.ts
Module build failed (from ../node_modules/@ngtools/webpack/src/index.js):
Error: C:\Users\admin\Documents\Native\myApp\app\register\register.module.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
    at AngularCompilerPlugin.getCompiledFile (C:\Users\admin\Documents\Native\myApp\node_modules\@ngtools\webpack\src\packages\ngtools\webpack\src\angular_compiler_plugin.ts:951:15)
    at plugin.done.then (C:\Users\admin\Documents\Native\myApp\node_modules\@ngtools\webpack\src\packages\ngtools\webpack\src\loader.ts:49:29)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
 @ ./app.routing.ts 17:132-171
 @ ./app.module.ts
 @ ./main.ts

ERROR in ./sub-setting/sub-setting.module.ts
Module build failed (from ../node_modules/@ngtools/webpack/src/index.js):
Error: C:\Users\admin\Documents\Native\myApp\app\sub-setting\sub-setting.module.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
    at AngularCompilerPlugin.getCompiledFile (C:\Users\admin\Documents\Native\myApp\node_modules\@ngtools\webpack\src\packages\ngtools\webpack\src\angular_compiler_plugin.ts:951:15)
    at plugin.done.then (C:\Users\admin\Documents\Native\myApp\node_modules\@ngtools\webpack\src\packages\ngtools\webpack\src\loader.ts:49:29)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
 @ ./app.routing.ts 24:132-177
 @ ./app.module.ts
 @ ./main.ts

@NickIliev
Copy link
Contributor

@jgerryl you could contact me in the community slack (username: niliev) and send me a sample project so I could investigate your case. The issue seems related to a configuration problem but without codebase to work with, I find it difficult to give any directions.

@andreaskarlssondev
Copy link

Hello, did you guys solve this problem ? i have the same

@brandontulsi
Copy link

Facing same issue

@NickIliev
Copy link
Contributor

@c13andka @btulsi-ygrene can you guys share sample projects that are reproducing the issue?

Please make sure that your project is updated to latest version of nativescript-dev-webpack . In this article, you can find automated upgrade scripts for Webpack and Angular.

@brandontulsi
Copy link

upgrading from 0.14.2 => 0.14.3 resolved the issue. not sure what about 0.14.2 caused the issue.

@jgerryl
Copy link
Author

jgerryl commented Jul 17, 2018

@btulsi-ygrene i'll try this solution

Thanks

@sis0k0 sis0k0 added backlog and removed backlog labels Aug 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants