René's URL Explorer Experiment


Title: Error: Cannot find module '@nativescript/webpack/nativescript-target' · Issue #1156 · NativeScript/nativescript-dev-webpack · GitHub

Open Graph Title: Error: Cannot find module '@nativescript/webpack/nativescript-target' · Issue #1156 · NativeScript/nativescript-dev-webpack

X Title: Error: Cannot find module '@nativescript/webpack/nativescript-target' · Issue #1156 · NativeScript/nativescript-dev-webpack

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: 8.0.2 Android Runtime: 8.0.0 iOS Runtime: n...

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: 8.0...

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: 8.0...

Opengraph URL: https://github.com/NativeScript/nativescript-dev-webpack/issues/1156

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Error: Cannot find module '@nativescript/webpack/nativescript-target'","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: 8.0.2\r\n - Android Runtime: 8.0.0\r\n - iOS Runtime: none\r\n - Plugin(s): none\r\n - Node.js: 14.17.1\r\n \r\npackage.json:\r\n```\r\n{\r\n  \"name\": \"aurora-spa\",\r\n  \"version\": \"0.0.0\",\r\n  \"scripts\": {\r\n    \"android\": \"ns run android --no-hmr\",\r\n    \"ios\": \"ns run ios --no-hmr\",\r\n    \"mobile\": \"ns run\",\r\n    \"ng\": \"ng\",\r\n    \"start\": \"ng serve\",\r\n    \"build\": \"ng build\",\r\n    \"test\": \"ng test\",\r\n    \"lint\": \"ng lint\",\r\n    \"e2e\": \"ng e2e\"\r\n  },\r\n  \"private\": true,\r\n  \"dependencies\": {\r\n    \"@nativescript/angular\": \"~11.8.0\",\r\n    \"@nativescript/core\": \"~8.0.0\",\r\n    \"@nativescript/theme\": \"~2.5.0\",\r\n    \"reflect-metadata\": \"~0.1.12\",\r\n    \"tslib\": \"^1.10.0\",\r\n    \"@angular/animations\": \"~12.0.5\",\r\n    \"@angular/common\": \"~12.0.5\",\r\n    \"@angular/compiler\": \"~12.0.5\",\r\n    \"@angular/core\": \"~12.0.5\",\r\n    \"@angular/forms\": \"~12.0.5\",\r\n    \"@angular/platform-browser\": \"~12.0.5\",\r\n    \"@angular/platform-browser-dynamic\": \"~12.0.5\",\r\n    \"@angular/router\": \"~12.0.5\",\r\n    \"@auth0/angular-jwt\": \"5.0.2\",\r\n    \"@fortawesome/angular-fontawesome\": \"^0.9.0\",\r\n    \"@fortawesome/fontawesome-svg-core\": \"^1.2.28\",\r\n    \"@fortawesome/free-regular-svg-icons\": \"^5.15.1\",\r\n    \"@fortawesome/free-solid-svg-icons\": \"^5.15.1\",\r\n    \"@ngrx/effects\": \"^12.1.0\",\r\n    \"@ngrx/store\": \"^12.1.0\",\r\n    \"axios\": \"^0.19.1\",\r\n    \"bootstrap\": \"^4.4.1\",\r\n    \"core-js\": \"^2.5.4\",\r\n    \"ng-sapphiredb\": \"^3.1.8\",\r\n    \"ngx-bootstrap\": \"^5.6.1\",\r\n    \"rxjs\": \"~6.6.7\",\r\n    \"sapphiredb\": \"^3.0.0\",\r\n    \"zone.js\": \"~0.11.4\"\r\n  },\r\n  \"devDependencies\": {\r\n    \"@angular/cli\": \"~12.0.5\",\r\n    \"@angular/compiler-cli\": \"~12.0.5\",\r\n    \"@angular/language-service\": \"~12.0.5\",\r\n    \"@nativescript/android\": \"8.0.0\",\r\n    \"@nativescript/schematics\": \"^11.2.0\",\r\n    \"@nativescript/tslint-rules\": \"~0.0.5\",\r\n    \"@ngrx/store-devtools\": \"^12.1.0\",\r\n    \"@types/jasmine\": \"~2.8.8\",\r\n    \"@types/jasminewd2\": \"~2.0.3\",\r\n    \"@types/node\": \"^12.11.1\",\r\n    \"codelyzer\": \"^5.1.2\",\r\n    \"jasmine-core\": \"~3.5.0\",\r\n    \"jasmine-spec-reporter\": \"~5.0.0\",\r\n    \"karma\": \"~6.3.4\",\r\n    \"karma-chrome-launcher\": \"~3.1.0\",\r\n    \"karma-coverage-istanbul-reporter\": \"~3.0.2\",\r\n    \"karma-jasmine\": \"~4.0.0\",\r\n    \"karma-jasmine-html-reporter\": \"^1.5.0\",\r\n    \"protractor\": \"~7.0.0\",\r\n    \"ts-node\": \"~7.0.0\",\r\n    \"tslint\": \"~6.1.0\",\r\n    \"typescript\": \"~4.2.4\",\r\n    \"@nativescript/webpack\": \"~5.0.0-beta.0\",\r\n    \"@ngtools/webpack\": \"~10.0.0\"\r\n  },\r\n  \"main\": \"./src/main.tns.ts\"\r\n}\r\n```\r\n\r\nwebpack.config.js:\r\n```\r\nconst { join, relative, resolve, sep, dirname } = require('path');\r\nconst fs = require('fs');\r\n\r\nconst webpack = require('webpack');\r\nconst nsWebpack = require('@nativescript/webpack');\r\nconst nativescriptTarget = require('@nativescript/webpack/nativescript-target');\r\nconst { nsSupportHmrNg } = require('@nativescript/webpack/transformers/ns-support-hmr-ng');\r\nconst { nsTransformNativeClassesNg } = require('@nativescript/webpack/transformers/ns-transform-native-classes-ng');\r\nconst { parseWorkspaceConfig, hasConfigurations } = require('@nativescript/webpack/helpers/angular-config-parser');\r\nconst { getMainModulePath } = require('@nativescript/webpack/utils/ast-utils');\r\nconst { getNoEmitOnErrorFromTSConfig, getCompilerOptionsFromTSConfig } = require('@nativescript/webpack/utils/tsconfig-utils');\r\nconst { CleanWebpackPlugin } = require('clean-webpack-plugin');\r\nconst CopyWebpackPlugin = require('copy-webpack-plugin');\r\nconst { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');\r\nconst { NativeScriptWorkerPlugin } = require('nativescript-worker-loader/NativeScriptWorkerPlugin');\r\nconst TerserPlugin = require('terser-webpack-plugin');\r\nconst { getAngularCompilerPlugin } = require('@nativescript/webpack/plugins/NativeScriptAngularCompilerPlugin');\r\nconst hashSalt = Date.now().toString();\r\n\r\nmodule.exports = (env) =\u003e {\r\n\tconst platform = env \u0026\u0026 ((env.android \u0026\u0026 'android') || (env.ios \u0026\u0026 'ios'));\r\n\tif (!platform) {\r\n\t\tthrow new Error('You need to provide a target platform!');\r\n\t}\r\n\r\n\tconst AngularCompilerPlugin = getAngularCompilerPlugin(platform);\r\n\tconst projectRoot = __dirname;\r\n\r\n\t// Default destination inside platforms/\u003cplatform\u003e/...\r\n\tconst dist = resolve(projectRoot, nsWebpack.getAppPath(platform, projectRoot));\r\n\r\n\tconst {\r\n\t\t// The 'appPath' and 'appResourcesPath' values are fetched from\r\n\t\t// the nsconfig.json configuration file\r\n\t\t// when bundling with `tns run android|ios --bundle`.\r\n\t\tappPath = 'src',\r\n\t\tappResourcesPath = 'App_Resources',\r\n\r\n\t\t// You can provide the following flags when running 'tns run android|ios'\r\n\t\tsnapshot, // --env.snapshot,\r\n\t\tproduction, // --env.production\r\n\t\tconfiguration, // --env.configuration (consistent with angular cli usage)\r\n\t\tprojectName, // --env.projectName (drive configuration through angular projects)\r\n\t\tuglify, // --env.uglify\r\n\t\treport, // --env.report\r\n\t\tsourceMap, // --env.sourceMap\r\n\t\thiddenSourceMap, // --env.hiddenSourceMap\r\n\t\thmr, // --env.hmr,\r\n\t\tunitTesting, // --env.unitTesting\r\n\t\ttesting, // --env.testing\r\n\t\tverbose, // --env.verbose\r\n\t\tci, // --env.ci\r\n\t\tsnapshotInDocker, // --env.snapshotInDocker\r\n\t\tskipSnapshotTools, // --env.skipSnapshotTools\r\n\t\tcompileSnapshot, // --env.compileSnapshot\r\n\t\tappComponents = [],\r\n\t\tentries = {},\r\n\t} = env;\r\n\r\n\tconst { fileReplacements, copyReplacements } = parseWorkspaceConfig(platform, configuration, projectName);\r\n\r\n\tconst useLibs = compileSnapshot;\r\n\tconst isAnySourceMapEnabled = !!sourceMap || !!hiddenSourceMap;\r\n\tconst externals = nsWebpack.getConvertedExternals(env.externals);\r\n\tconst appFullPath = resolve(projectRoot, appPath);\r\n\tconst appResourcesFullPath = resolve(projectRoot, appResourcesPath);\r\n\tlet tsConfigName = 'tsconfig.json';\r\n\tlet tsConfigPath = resolve(projectRoot, tsConfigName);\r\n\tconst tsConfigTnsName = 'tsconfig.tns.json';\r\n\tconst tsConfigTnsPath = resolve(projectRoot, tsConfigTnsName);\r\n\tif (fs.existsSync(tsConfigTnsPath)) {\r\n\t\t// support shared angular app configurations\r\n\t\ttsConfigName = tsConfigTnsName;\r\n\t\ttsConfigPath = tsConfigTnsPath;\r\n\t}\r\n\tconst tsConfigEnvName = 'tsconfig.env.json';\r\n\tconst tsConfigEnvPath = resolve(projectRoot, tsConfigEnvName);\r\n\tif (hasConfigurations(configuration) \u0026\u0026 fs.existsSync(tsConfigEnvPath)) {\r\n\t\t// when configurations are used, switch to environments supported config\r\n\t\ttsConfigName = tsConfigEnvName;\r\n\t\ttsConfigPath = tsConfigEnvPath;\r\n\t}\r\n\tconst entryModule = `${nsWebpack.getEntryModule(appFullPath, platform)}.ts`;\r\n\tconst entryPath = `.${sep}${entryModule}`;\r\n\tObject.assign(entries, { bundle: entryPath }, entries);\r\n\tconst areCoreModulesExternal = Array.isArray(env.externals) \u0026\u0026 env.externals.some((e) =\u003e e.indexOf('@nativescript') \u003e -1);\r\n\tif (platform === 'ios' \u0026\u0026 !areCoreModulesExternal \u0026\u0026 !testing) {\r\n\t\tentries['tns_modules/inspector_modules'] = '@nativescript/core/inspector_modules';\r\n\t}\r\n\r\n\tconst compilerOptions = getCompilerOptionsFromTSConfig(tsConfigPath);\r\n\tnsWebpack.processTsPathsForScopedModules({ compilerOptions });\r\n\tnsWebpack.processTsPathsForScopedAngular({ compilerOptions });\r\n\r\n\tconst ngCompilerTransformers = [nsTransformNativeClassesNg];\r\n\tconst additionalLazyModuleResources = [];\r\n\r\n\tconst copyIgnore = { ignore: [`${relative(appPath, appResourcesFullPath)}/**`] };\r\n\tconst copyTargets = [{ from: { glob: 'assets/**', dot: false } }, { from: { glob: 'fonts/**', dot: false } }, ...copyReplacements];\r\n\r\n\tif (!production) {\r\n\t\t// for development purposes only\r\n\t\t// for example, include mock json folder\r\n\t\t// copyTargets.push({ from: 'tools/mockdata', to: 'assets/mockdata' });\r\n\r\n\t\tif (hmr) {\r\n\t\t\tngCompilerTransformers.push(nsSupportHmrNg);\r\n\t\t}\r\n\t}\r\n\r\n\t// when \"@angular/core\" is external, it's not included in the bundles. In this way, it will be used\r\n\t// directly from node_modules and the Angular modules loader won't be able to resolve the lazy routes\r\n\t// fixes https://github.com/NativeScript/nativescript-cli/issues/4024\r\n\tif (env.externals \u0026\u0026 env.externals.indexOf('@angular/core') \u003e -1) {\r\n\t\tconst appModuleRelativePath = getMainModulePath(resolve(appFullPath, entryModule), tsConfigName);\r\n\t\tif (appModuleRelativePath) {\r\n\t\t\tconst appModuleFolderPath = dirname(resolve(appFullPath, appModuleRelativePath));\r\n\t\t\t// include the new lazy loader path in the allowed ones\r\n\t\t\tadditionalLazyModuleResources.push(appModuleFolderPath);\r\n\t\t}\r\n\t}\r\n\r\n\tconst ngCompilerPlugin = new AngularCompilerPlugin({\r\n\t\thostReplacementPaths: nsWebpack.getResolver([platform, 'tns']),\r\n\t\tplatformTransformers: ngCompilerTransformers.map((t) =\u003e t(() =\u003e ngCompilerPlugin, resolve(appFullPath, entryModule), projectRoot)),\r\n\t\tmainPath: join(appFullPath, entryModule),\r\n\t\ttsConfigPath,\r\n\t\tskipCodeGeneration: false,\r\n\t\tsourceMap: !!isAnySourceMapEnabled,\r\n\t\tadditionalLazyModuleResources: additionalLazyModuleResources,\r\n\t\tcompilerOptions: { paths: compilerOptions.paths },\r\n\t});\r\n\r\n\tlet sourceMapFilename = nsWebpack.getSourceMapFilename(hiddenSourceMap, __dirname, dist);\r\n\r\n\tconst itemsToClean = [`${dist}/**/*`];\r\n\tif (platform === 'android') {\r\n\t\titemsToClean.push(`${join(projectRoot, 'platforms', 'android', 'app', 'src', 'main', 'assets', 'snapshots')}`);\r\n\t\titemsToClean.push(`${join(projectRoot, 'platforms', 'android', 'app', 'build', 'configurations', 'nativescript-android-snapshot')}`);\r\n\t}\r\n\r\n\tconst noEmitOnErrorFromTSConfig = getNoEmitOnErrorFromTSConfig(tsConfigName);\r\n\r\n\t// Add your custom Activities, Services and other android app components here.\r\n\tappComponents.push('@nativescript/core/ui/frame', '@nativescript/core/ui/frame/activity');\r\n\r\n\tnsWebpack.processAppComponents(appComponents, platform);\r\n\tconst config = {\r\n\t\tmode: production ? 'production' : 'development',\r\n\t\tcontext: appFullPath,\r\n\t\texternals,\r\n\t\twatchOptions: {\r\n\t\t\tignored: [\r\n\t\t\t\tappResourcesFullPath,\r\n\t\t\t\t// Don't watch hidden files\r\n\t\t\t\t'**/.*',\r\n\t\t\t],\r\n\t\t},\r\n\t\ttarget: nativescriptTarget,\r\n\t\tentry: entries,\r\n\t\toutput: {\r\n\t\t\tpathinfo: false,\r\n\t\t\tpath: dist,\r\n\t\t\tsourceMapFilename,\r\n\t\t\tlibraryTarget: 'commonjs2',\r\n\t\t\tfilename: '[name].js',\r\n\t\t\tglobalObject: 'global',\r\n\t\t\thashSalt,\r\n\t\t},\r\n\t\tresolve: {\r\n\t\t\textensions: ['.ts', '.js', '.scss', '.css'],\r\n\t\t\t// Resolve {N} system modules from @nativescript/core\r\n\t\t\tmodules: [resolve(__dirname, 'node_modules/@nativescript/core'), resolve(__dirname, 'node_modules'), 'node_modules/@nativescript/core', 'node_modules'],\r\n\t\t\talias: {\r\n\t\t\t\t'~/package.json': resolve(projectRoot, 'package.json'),\r\n\t\t\t\t'~': appFullPath,\r\n\t\t\t\t'tns-core-modules': '@nativescript/core',\r\n\t\t\t\t'nativescript-angular': '@nativescript/angular',\r\n\t\t\t\t...fileReplacements,\r\n\t\t\t},\r\n\t\t\tsymlinks: true,\r\n\t\t},\r\n\t\tresolveLoader: {\r\n\t\t\tsymlinks: false,\r\n\t\t},\r\n\t\tnode: {\r\n\t\t\t// Disable node shims that conflict with NativeScript\r\n\t\t\thttp: false,\r\n\t\t\ttimers: false,\r\n\t\t\tsetImmediate: false,\r\n\t\t\tfs: 'empty',\r\n\t\t\t__dirname: false,\r\n\t\t},\r\n\t\tdevtool: hiddenSourceMap ? 'hidden-source-map' : sourceMap ? 'inline-source-map' : 'none',\r\n\t\toptimization: {\r\n\t\t\truntimeChunk: 'single',\r\n\t\t\tnoEmitOnErrors: noEmitOnErrorFromTSConfig,\r\n\t\t\tsplitChunks: {\r\n\t\t\t\tcacheGroups: {\r\n\t\t\t\t\tvendor: {\r\n\t\t\t\t\t\tname: 'vendor',\r\n\t\t\t\t\t\tchunks: 'all',\r\n\t\t\t\t\t\ttest: (module, chunks) =\u003e {\r\n\t\t\t\t\t\t\tconst moduleName = module.nameForCondition ? module.nameForCondition() : '';\r\n\t\t\t\t\t\t\treturn /[\\\\/]node_modules[\\\\/]/.test(moduleName) || appComponents.some((comp) =\u003e comp === moduleName);\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tenforce: true,\r\n\t\t\t\t\t},\r\n\t\t\t\t},\r\n\t\t\t},\r\n\t\t\tminimize: !!uglify,\r\n\t\t\tminimizer: [\r\n\t\t\t\tnew TerserPlugin({\r\n\t\t\t\t\tparallel: true,\r\n\t\t\t\t\tcache: !ci,\r\n\t\t\t\t\tsourceMap: isAnySourceMapEnabled,\r\n\t\t\t\t\tterserOptions: {\r\n\t\t\t\t\t\toutput: {\r\n\t\t\t\t\t\t\tcomments: false,\r\n\t\t\t\t\t\t\tsemicolons: !isAnySourceMapEnabled,\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tcompress: {\r\n\t\t\t\t\t\t\t// The Android SBG has problems parsing the output\r\n\t\t\t\t\t\t\t// when these options are enabled\r\n\t\t\t\t\t\t\tcollapse_vars: platform !== 'android',\r\n\t\t\t\t\t\t\tsequences: platform !== 'android',\r\n\t\t\t\t\t\t\t// For v8 Compatibility\r\n\t\t\t\t\t\t\tkeep_infinity: true, // for V8\r\n\t\t\t\t\t\t\treduce_funcs: false, // for V8\r\n\t\t\t\t\t\t\t// custom\r\n\t\t\t\t\t\t\tdrop_console: production,\r\n\t\t\t\t\t\t\tdrop_debugger: true,\r\n\t\t\t\t\t\t\tecma: 6,\r\n\t\t\t\t\t\t\tglobal_defs: {\r\n\t\t\t\t\t\t\t\t__UGLIFIED__: true,\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t// Required for Element Level CSS, Observable Events, \u0026 Android Frame\r\n\t\t\t\t\t\tkeep_classnames: true,\r\n\t\t\t\t\t\t// custom\r\n\t\t\t\t\t\tecma: 6,\r\n\t\t\t\t\t\tsafari10: platform !== 'android',\r\n\t\t\t\t\t},\r\n\t\t\t\t}),\r\n\t\t\t],\r\n\t\t},\r\n\t\tmodule: {\r\n\t\t\trules: [\r\n\t\t\t\t{\r\n\t\t\t\t\tinclude: join(appFullPath, entryPath),\r\n\t\t\t\t\tuse: [\r\n\t\t\t\t\t\t// Require all Android app components\r\n\t\t\t\t\t\tplatform === 'android' \u0026\u0026 {\r\n\t\t\t\t\t\t\tloader: '@nativescript/webpack/helpers/android-app-components-loader',\r\n\t\t\t\t\t\t\toptions: { modules: appComponents },\r\n\t\t\t\t\t\t},\r\n\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tloader: '@nativescript/webpack/bundle-config-loader',\r\n\t\t\t\t\t\t\toptions: {\r\n\t\t\t\t\t\t\t\tangular: true,\r\n\t\t\t\t\t\t\t\tloadCss: !snapshot, // load the application css if in debug mode\r\n\t\t\t\t\t\t\t\tunitTesting,\r\n\t\t\t\t\t\t\t\tappFullPath,\r\n\t\t\t\t\t\t\t\tprojectRoot,\r\n\t\t\t\t\t\t\t\tignoredFiles: nsWebpack.getUserDefinedEntries(entries, platform),\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t].filter((loader) =\u003e !!loader),\r\n\t\t\t\t},\r\n\r\n\t\t\t\t{ test: /\\.html$|\\.xml$/, use: 'raw-loader' },\r\n\r\n\t\t\t\t{\r\n\t\t\t\t\ttest: /[\\/|\\\\]app\\.css$/,\r\n\t\t\t\t\tuse: [\r\n\t\t\t\t\t\t'@nativescript/webpack/helpers/style-hot-loader',\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tloader: '@nativescript/webpack/helpers/css2json-loader',\r\n\t\t\t\t\t\t\toptions: { useForImports: true },\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t],\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\ttest: /[\\/|\\\\]app\\.scss$/,\r\n\t\t\t\t\tuse: [\r\n\t\t\t\t\t\t'@nativescript/webpack/helpers/style-hot-loader',\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tloader: '@nativescript/webpack/helpers/css2json-loader',\r\n\t\t\t\t\t\t\toptions: { useForImports: true },\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t'sass-loader',\r\n\t\t\t\t\t],\r\n\t\t\t\t},\r\n\r\n\t\t\t\t// Angular components reference css files and their imports using raw-loader\r\n\t\t\t\t{ test: /\\.css$/, exclude: /[\\/|\\\\]app\\.css$/, use: 'raw-loader' },\r\n\t\t\t\t{\r\n\t\t\t\t\ttest: /\\.scss$/,\r\n\t\t\t\t\texclude: /[\\/|\\\\]app\\.scss$/,\r\n\t\t\t\t\tuse: ['raw-loader', 'resolve-url-loader', 'sass-loader'],\r\n\t\t\t\t},\r\n\r\n\t\t\t\t{\r\n\t\t\t\t\ttest: /(?:\\.ngfactory\\.js|\\.ngstyle\\.js|\\.ts)$/,\r\n\t\t\t\t\tuse: ['@nativescript/webpack/helpers/moduleid-compat-loader', '@nativescript/webpack/helpers/lazy-ngmodule-hot-loader', '@ngtools/webpack'],\r\n\t\t\t\t},\r\n\r\n\t\t\t\t// Mark files inside `@angular/core` as using SystemJS style dynamic imports.\r\n\t\t\t\t// Removing this will cause deprecation warnings to appear.\r\n\t\t\t\t{\r\n\t\t\t\t\ttest: /[\\/\\\\]@angular[\\/\\\\]core[\\/\\\\].+\\.js$/,\r\n\t\t\t\t\tparser: { system: true },\r\n\t\t\t\t},\r\n\t\t\t],\r\n\t\t},\r\n\t\tplugins: [\r\n\t\t\t// Define useful constants like TNS_WEBPACK\r\n\t\t\tnew webpack.DefinePlugin({\r\n\t\t\t\t'global.TNS_WEBPACK': 'true',\r\n\t\t\t\t'global.isAndroid': platform === 'android',\r\n\t\t\t\t'global.isIOS': platform === 'ios',\r\n\t\t\t\tprocess: 'global.process',\r\n\t\t\t}),\r\n\t\t\t// Remove all files from the out dir.\r\n\t\t\tnew CleanWebpackPlugin({\r\n\t\t\t\tcleanOnceBeforeBuildPatterns: itemsToClean,\r\n\t\t\t\tverbose: !!verbose,\r\n\t\t\t}),\r\n\t\t\t// Copy assets\r\n\t\t\tnew CopyWebpackPlugin([...copyTargets, { from: { glob: '**/*.jpg', dot: false } }, { from: { glob: '**/*.png', dot: false } }], copyIgnore),\r\n\t\t\tnew nsWebpack.GenerateNativeScriptEntryPointsPlugin('bundle'),\r\n\t\t\t// For instructions on how to set up workers with webpack\r\n\t\t\t// check out https://github.com/nativescript/worker-loader\r\n\t\t\tnew NativeScriptWorkerPlugin(),\r\n\t\t\tngCompilerPlugin,\r\n\t\t\t// Does IPC communication with the {N} CLI to notify events when running in watch mode.\r\n\t\t\tnew nsWebpack.WatchStateLoggerPlugin(),\r\n\t\t],\r\n\t};\r\n\r\n\tif (report) {\r\n\t\t// Generate report files for bundles content\r\n\t\tconfig.plugins.push(\r\n\t\t\tnew BundleAnalyzerPlugin({\r\n\t\t\t\tanalyzerMode: 'static',\r\n\t\t\t\topenAnalyzer: false,\r\n\t\t\t\tgenerateStatsFile: true,\r\n\t\t\t\treportFilename: resolve(projectRoot, 'report', `report.html`),\r\n\t\t\t\tstatsFilename: resolve(projectRoot, 'report', `stats.json`),\r\n\t\t\t})\r\n\t\t);\r\n\t}\r\n\r\n\tif (snapshot) {\r\n\t\tconfig.plugins.push(\r\n\t\t\tnew nsWebpack.NativeScriptSnapshotPlugin({\r\n\t\t\t\tchunk: 'vendor',\r\n\t\t\t\tangular: true,\r\n\t\t\t\trequireModules: ['reflect-metadata', '@angular/platform-browser', '@angular/core', '@angular/common', '@angular/router', '@nativescript/angular'],\r\n\t\t\t\tprojectRoot,\r\n\t\t\t\twebpackConfig: config,\r\n\t\t\t\tsnapshotInDocker,\r\n\t\t\t\tskipSnapshotTools,\r\n\t\t\t\tuseLibs,\r\n\t\t\t})\r\n\t\t);\r\n\t}\r\n\r\n\tif (!production \u0026\u0026 hmr) {\r\n\t\tconfig.plugins.push(new webpack.HotModuleReplacementPlugin());\r\n\t}\r\n\r\n\treturn config;\r\n};\r\n```\r\n\r\n**Describe the bug**\r\nWhen I try to run `ns run android` I get the following error:\r\n```\r\nC:\\Git\\aurora-spa\u003ens run android\r\nSearching for devices...\r\nPreparing project...\r\nError: Cannot find module '@nativescript/webpack/nativescript-target'\r\nRequire stack:\r\n- C:\\Git\\aurora-spa\\webpack.config.js\r\n- C:\\Git\\aurora-spa\\node_modules\\@nativescript\\webpack\\dist\\bin\\index.js\r\n    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)\r\n    at Function.Module._load (internal/modules/cjs/loader.js:746:27)\r\n    at Module.require (internal/modules/cjs/loader.js:974:19)\r\n    at require (internal/modules/cjs/helpers.js:92:18)\r\n    at Object.\u003canonymous\u003e (C:\\Git\\aurora-spa\\webpack.config.js:6:28)\r\n    at Module._compile (internal/modules/cjs/loader.js:1085:14)\r\n    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)\r\n    at Module.load (internal/modules/cjs/loader.js:950:32)\r\n    at Function.Module._load (internal/modules/cjs/loader.js:790:14)\r\n    at Module.require (internal/modules/cjs/loader.js:974:19)\r\n    at require (internal/modules/cjs/helpers.js:92:18)\r\n    at Command.\u003canonymous\u003e (C:\\Git\\aurora-spa\\node_modules\\@nativescript\\webpack\\dist\\bin\\index.js:60:25)\r\n    at Command.listener [as _actionHandler] (C:\\Git\\aurora-spa\\node_modules\\commander\\index.js:922:31)\r\n    at Command._parseCommand (C:\\Git\\aurora-spa\\node_modules\\commander\\index.js:1503:14)\r\n    at Command._dispatchSubcommand (C:\\Git\\aurora-spa\\node_modules\\commander\\index.js:1443:18)\r\n    at Command._parseCommand (C:\\Git\\aurora-spa\\node_modules\\commander\\index.js:1460:12) {\r\n  code: 'MODULE_NOT_FOUND',\r\n  requireStack: [\r\n    'C:\\\\Git\\\\aurora-spa\\\\webpack.config.js',\r\n    'C:\\\\Git\\\\aurora-spa\\\\node_modules\\\\@nativescript\\\\webpack\\\\dist\\\\bin\\\\index.js'\r\n  ]\r\n}\r\nNo configuration!\r\nExecuting webpack failed with exit code 0.\r\n```\r\n\r\n**To Reproduce**\r\nRun the following command:  `ns run android`.\r\n\r\n**Expected behavior**\r\nRuns project on emulator.\r\n","author":{"url":"https://github.com/pieveee","@type":"Person","name":"pieveee"},"datePublished":"2021-06-27T18:40:01.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1156/nativescript-dev-webpack/issues/1156"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:f2437b19-149f-a739-33cc-d3b205bcc886
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id81AC:1BBE0B:7AABB3A:9E94645:6975C789
html-safe-noncecc6854e3aad796318b5ffaf7a678772ae014553377616ca20822866aebc4c6d3
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MUFDOjFCQkUwQjo3QUFCQjNBOjlFOTQ2NDU6Njk3NUM3ODkiLCJ2aXNpdG9yX2lkIjoiMjQ4MzkwMTg4ODIzOTg4MDA3MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac0c227ac8170679c34602e788483dbe6c8dae82d1f36f1373a404d0bc96a95dc4
hovercard-subject-tagissue:930993476
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NativeScript/nativescript-dev-webpack/1156/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3eb953efa72e115663e0709d9e9d80f94a769b92ea7a475c5bcef39d1961c514/NativeScript/nativescript-dev-webpack/issues/1156
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3eb953efa72e115663e0709d9e9d80f94a769b92ea7a475c5bcef39d1961c514/NativeScript/nativescript-dev-webpack/issues/1156
og:image:altEnvironment 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: 8.0...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamepieveee
hostnamegithub.com
expected-hostnamegithub.com
None4a4bf5f4e28041a9d2e5c107d7d20b78b4294ba261cab243b28167c16a623a1f
turbo-cache-controlno-preview
go-importgithub.com/NativeScript/nativescript-dev-webpack git https://github.com/NativeScript/nativescript-dev-webpack.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id54984270
octolytics-dimension-repository_nwoNativeScript/nativescript-dev-webpack
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id54984270
octolytics-dimension-repository_network_root_nwoNativeScript/nativescript-dev-webpack
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release488b30e96dfd057fbbe44c6665ccbc030b729dde
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/NativeScript/nativescript-dev-webpack/issues/1156#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fnativescript-dev-webpack%2Fissues%2F1156
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fnativescript-dev-webpack%2Fissues%2F1156
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=NativeScript%2Fnativescript-dev-webpack
Reloadhttps://patch-diff.githubusercontent.com/NativeScript/nativescript-dev-webpack/issues/1156
Reloadhttps://patch-diff.githubusercontent.com/NativeScript/nativescript-dev-webpack/issues/1156
Reloadhttps://patch-diff.githubusercontent.com/NativeScript/nativescript-dev-webpack/issues/1156
NativeScript https://patch-diff.githubusercontent.com/NativeScript
nativescript-dev-webpackhttps://patch-diff.githubusercontent.com/NativeScript/nativescript-dev-webpack
Please reload this pagehttps://patch-diff.githubusercontent.com/NativeScript/nativescript-dev-webpack/issues/1156
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2FNativeScript%2Fnativescript-dev-webpack
Fork 40 https://patch-diff.githubusercontent.com/login?return_to=%2FNativeScript%2Fnativescript-dev-webpack
Star 97 https://patch-diff.githubusercontent.com/login?return_to=%2FNativeScript%2Fnativescript-dev-webpack
Code https://patch-diff.githubusercontent.com/NativeScript/nativescript-dev-webpack
Issues 82 https://patch-diff.githubusercontent.com/NativeScript/nativescript-dev-webpack/issues
Pull requests 3 https://patch-diff.githubusercontent.com/NativeScript/nativescript-dev-webpack/pulls
Actions https://patch-diff.githubusercontent.com/NativeScript/nativescript-dev-webpack/actions
Security 0 https://patch-diff.githubusercontent.com/NativeScript/nativescript-dev-webpack/security
Insights https://patch-diff.githubusercontent.com/NativeScript/nativescript-dev-webpack/pulse
Code https://patch-diff.githubusercontent.com/NativeScript/nativescript-dev-webpack
Issues https://patch-diff.githubusercontent.com/NativeScript/nativescript-dev-webpack/issues
Pull requests https://patch-diff.githubusercontent.com/NativeScript/nativescript-dev-webpack/pulls
Actions https://patch-diff.githubusercontent.com/NativeScript/nativescript-dev-webpack/actions
Security https://patch-diff.githubusercontent.com/NativeScript/nativescript-dev-webpack/security
Insights https://patch-diff.githubusercontent.com/NativeScript/nativescript-dev-webpack/pulse
Error: Cannot find module '@nativescript/webpack/nativescript-target'https://patch-diff.githubusercontent.com/NativeScript/nativescript-dev-webpack/issues/1156#top
https://github.com/pieveee
https://github.com/pieveee
pieveeehttps://github.com/pieveee
on Jun 27, 2021https://github.com/NativeScript/nativescript-dev-webpack/issues/1156#issue-930993476
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.