(babel plugin) Error: .sourceMap must be a boolean, "inline", "both", or undefined - babeljs

When attempting to package a nuxt component, I get the above error. I am running nuxt 2.4.5, #babel/core 7.0.0 and rollup 1.4.0.
Does anyone have any thoughts?
Thanks in advance..
npm run script:
"build:es": "rollup --config build/rollup.config.js --format es --file dist/cxl-nuxt-map.esm.js"
Command :
nr build:es
cxl-nuxt-map#1.0.0 build:es /Users/userinfo/Projects/cxl-nuxt-map rollup --config build/rollup.config.js --format es --file dist/cxl-nuxt-map.esm.js
index.js → dist/cxl-nuxt-map.esm.js...
Stack Trace:
[!] (babel plugin) Error: .sourceMap must be a boolean, "inline", "both", or undefined
index.js
Error: .sourceMap must be a boolean, "inline", "both", or undefined
at assertSourceMaps (/Users/dan.mahoney/Projects/cxl-nuxt-map/node_modules/#babel/core/lib/config/validation/option-assertions.js:65:11)
at Object.keys.forEach.key (/Users/dan.mahoney/Projects/cxl-nuxt-map/node_modules/#babel/core/lib/config/validation/options.js:107:5)
at Array.forEach (<anonymous>)
at validateNested (/Users/dan.mahoney/Projects/cxl-nuxt-map/node_modules/#babel/core/lib/config/validation/options.js:83:21)
at validate (/Users/dan.mahoney/Projects/cxl-nuxt-map/node_modules/#babel/core/lib/config/validation/options.js:74:10)
at file (/Users/dan.mahoney/Projects/cxl-nuxt-map/node_modules/#babel/core/lib/config/config-chain.js:174:34)
at cachedFunction (/Users/dan.mahoney/Projects/cxl-nuxt-map/node_modules/#babel/core/lib/config/caching.js:33:19)
at buildRootChain (/Users/dan.mahoney/Projects/cxl-nuxt-map/node_modules/#babel/core/lib/config/config-chain.js:120:36)
at loadPrivatePartialConfig (/Users/dan.mahoney/Projects/cxl-nuxt-map/node_modules/#babel/core/lib/config/partial.js:85:55)
at Object.loadPartialConfig (/Users/dan.mahoney/Projects/cxl-nuxt-map/node_modules/#babel/core/lib/config/partial.js:110:18)
at Object.babel.loadPartialConfig (/Users/dan.mahoney/Projects/cxl-nuxt-map/node_modules/rollup-plugin-babel/src/index.js:80:20)
at /Users/dan.mahoney/Projects/cxl-nuxt-map/node_modules/rollup/dist/rollup.js:17051:25
at process.runNextTicks [as _tickCallback] (internal/process/next_tick.js:47:5)
at Function.Module.runMain (internal/modules/cjs/loader.js:804:11)
at internal/main/run_main_module.js:21:11
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cxl-nuxt-map#1.0.0 build:es: `rollup --config build/rollup.config.js --format es --file dist/cxl-nuxt-map.esm.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cxl-nuxt-map#1.0.0 build:es script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/dan.mahoney/.npm/_logs/2019-03-01T20_10_17_889Z-debug.log
Rollup.config.js:
/* rollup.config.js */
import vue from 'rollup-plugin-vue';
import babel from 'rollup-plugin-babel';
import commonjs from 'rollup-plugin-commonjs';
import postcss from 'rollup-plugin-postcss';
import replace from 'rollup-plugin-replace';
import { plugin as analyze } from 'rollup-plugin-analyzer';
export default {
input: 'index.js',
output: {
name: 'CxlNuxtMap',
exports: 'named',
},
plugins: [
postcss({
extensions: ['.css'],
runtimeHelpers: true,
exclude: 'node_modules/**',
}),
vue(),
babel({
exclude: 'node_modules/**',
}),
replace({
'process.env.INCLUDE_DEPS': JSON.stringify('false'),
}),
replace({
'process.env.NODE_ENV': JSON.stringify('production'),
}),
commonjs({
namedExports: {},
}),
analyze({ stdout: true }),
],
};

Found in the problem in my .babelrc file. The offending line was:
"sourceMap": "true",
should be:
"sourceMaps": true,

Related

Create a Custom Android Plugin: java.lang.NullPointerException (no error message)

I´m developing this Android application to run on device.
I´m using Ionic and Angular to develop the application.
Now I need to create a custom plugin using Plugman. This plugin should allowed user to authentication using IBM APP ID.
I followed the instructions mention here https://github.com/ibm-cloud-security/appid-clientsdk-android
to create my gradle file.
However, when I run ionic cordova run android --verbose --debug
I get this error
What went wrong:
Execution failed for task :app:processDebugManifest.
java.lang.NullPointerException (no error message)
And I have no clue what could be the root cause. This is my first time I develop a custom plugin.
My suspicious relies on the dependency, but I can not tell what part is causing the issue.
Ionic Framework : #ionic/angular 5.0.7
#angular-devkit/build-angular : 0.803.26
#angular-devkit/schematics : 8.3.26
#angular/cli : 8.3.26
#ionic/angular-toolkit : 2.2.0
Cordova:
Cordova CLI : 10.0.0
Cordova Platforms : android 8.1.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 7 other plugins)
Utility:
cordova-res (update available: 0.14.0) : 0.10.0
native-run (update available: 1.0.0) : 0.3.0
System:
Android SDK Tools : 26.1.1 (C:\\Android\\sdk)
NodeJS : v14.2.0 (C:\Program Files\\nodejs\\node.exe)
npm : 6.14.4
OS : Windows 10```
LOG=======================================
C:\project_cren\plugin\ci-uix-mobile-master>ionic cordova run android --verbose --debug
ionic:lib Terminal info: { ci: false, shell: 'C:\\WINDOWS\\system32\\cmd.exe', tty: false, windows: true } +0ms
ionic:lib CLI global options: { _: [ 'cordova', 'run', 'android' ], help: null, h: null, verbose: true, quiet: null, interactive: false, color: true, confirm: null, json: null, debug: true, project: null, '--': [] } +4ms
ionic:lib:project Project type from config: #ionic/angular (angular) +0ms
ionic:lib:project Project details: { configPath: 'C:\\project_cren\\plugin\\ci-uix-mobile-master\\ionic.config.json', errors: [], context: 'app', type: 'angular' } +1ms
ionic Context: { binPath: 'C:\\Users\\AMANDODOSSANTOSNETO\\AppData\\Roaming\\npm\\node_modules\\#ionic\\cli\\bin\\ionic', libPath: 'C:\\Users\\AMANDODOSSANTOSNETO\\AppData\\Roaming\\npm\\node_modules\\#ionic\\cli', execPath: 'C:\\project_cren\\plugin\\ci-uix-mobile-master', version: '6.7.0' } +0ms
ionic:lib:integrations:cordova:config Loading Cordova Config (config.xml: 'C:\\project_cren\\plugin\\ci-uix-mobile-master\\config.xml', package.json: 'C:\\project_cren\\plugin\\ci-uix-mobile-master\\package.json') +0ms
ionic:commands:run Native platform devices: [] +0ms
ionic:lib:integrations:cordova:config Loading Cordova Config (config.xml: 'C:\\project_cren\\plugin\\ci-uix-mobile-master\\config.xml', package.json: 'C:\\project_cren\\plugin\\ci-uix-mobile-master\\package.json') +11s
ionic:lib:build build options: {
ionic:lib:build '--': [],
ionic:lib:build engine: 'cordova',
ionic:lib:build platform: 'android',
ionic:lib:build project: 'app',
ionic:lib:build verbose: false,
ionic:lib:build configuration: undefined,
ionic:lib:build sourcemaps: undefined,
ionic:lib:build cordovaAssets: true,
ionic:lib:build watch: undefined,
ionic:lib:build type: 'angular'
ionic:lib:build } +0ms
ionic:lib:hooks Looking for ionic:build:before npm script. +0ms
ionic:lib:build Looking for ionic:build npm script. +154ms
ng:analytics getGlobalAnalytics +0ms
ng:analytics Client Analytics config found: false +47ms
ng:analytics Analytics disabled. Ignoring all analytics. +1ms
ng:analytics getSharedAnalytics +0ms
WARNING in ./src/app/invoice-detail/invoice-detail.component.scss
Module Warning (from ./node_modules/postcss-loader/src/index.js):
Warning
(4:3) start value has mixed support, consider using flex-start instead
# ./src/app/invoice-detail/invoice-detail.component.ts 27:41-83
# ./src/app/app.module.ts
# ./src/main.ts
# multi ./src/main.ts
ionic:lib:hooks Looking for ionic:build:after npm script. +40s
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> java.lang.NullPointerException (no error message)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 13s
C:\project_cren\plugin\ci-uix-mobile-master\platforms\android\gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> java.lang.NullPointerException (no error message)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 13s
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd build android --debug --verbose exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
ionic:utils-process onBeforeExit handler: 'process.exit' received +0ms
ionic:utils-process onBeforeExit handler: running 2 functions +1ms
ionic:utils-process error while killing process tree for 17344: Error: Command failed: taskkill /pid 17344 /T /F
ionic:utils-process ERROR: The process "17344" not found.
ionic:utils-process
ionic:utils-process at ChildProcess.exithandler (child_process.js:303:12)
ionic:utils-process at ChildProcess.emit (events.js:315:20)
ionic:utils-process at maybeClose (internal/child_process.js:1051:16)
ionic:utils-process at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {
ionic:utils-process killed: false,
ionic:utils-process code: 128,
ionic:utils-process signal: null,
ionic:utils-process cmd: 'taskkill /pid 17344 /T /F'
ionic:utils-process } +472ms
ionic:utils-process onBeforeExit handler: error from function: Error: Command failed: taskkill /pid 17344 /T /F
ionic:utils-process ERROR: The process "17344" not found.
ionic:utils-process
ionic:utils-process at ChildProcess.exithandler (child_process.js:303:12)
ionic:utils-process at ChildProcess.emit (events.js:315:20)
ionic:utils-process at maybeClose (internal/child_process.js:1051:16)
ionic:utils-process at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {
ionic:utils-process killed: false,
ionic:utils-process code: 128,
ionic:utils-process signal: null,
ionic:utils-process cmd: 'taskkill /pid 17344 /T /F'
ionic:utils-process } +21ms
ionic:utils-process error while killing process tree for 2628: Error: Command failed: taskkill /pid 2628 /T /F
ionic:utils-process ERROR: The process "2628" not found.
ionic:utils-process
ionic:utils-process at ChildProcess.exithandler (child_process.js:303:12)
ionic:utils-process at ChildProcess.emit (events.js:315:20)
ionic:utils-process at maybeClose (internal/child_process.js:1051:16)
ionic:utils-process at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {
ionic:utils-process killed: false,
ionic:utils-process code: 128,
ionic:utils-process signal: null,
ionic:utils-process cmd: 'taskkill /pid 2628 /T /F'
ionic:utils-process } +40ms
ionic:utils-process onBeforeExit handler: error from function: Error: Command failed: taskkill /pid 2628 /T /F
ionic:utils-process ERROR: The process "2628" not found.
ionic:utils-process
ionic:utils-process at ChildProcess.exithandler (child_process.js:303:12)
ionic:utils-process at ChildProcess.emit (events.js:315:20)
ionic:utils-process at maybeClose (internal/child_process.js:1051:16)
ionic:utils-process at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {
ionic:utils-process killed: false,
ionic:utils-process code: 128,
ionic:utils-process signal: null,
ionic:utils-process cmd: 'taskkill /pid 2628 /T /F'
ionic:utils-process } +8ms
ionic:utils-process processExit: exiting (exit code: 1) +4ms
GRADLE FILE=====================================================================
android {
//compileSdkVersion 29
//buildToolsVersion "29.0.3"
defaultConfig {
manifestPlaceholders = ['appIdRedirectScheme': android.defaultConfig.applicationId]
}
}
dependencies {
implementation 'com.github.ibm-cloud-security:appid-clientsdk-android:6.+'
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
JAVA FILE ==============================================
package ibm.com.ibmappidcordovaplugin;
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.CallbackContext;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import com.ibm.cloud.appid.android.api.AppID;
import com.ibm.cloud.appid.android.api.AuthorizationException;
import com.ibm.cloud.appid.android.api.AuthorizationListener;
import com.ibm.cloud.appid.android.api.LoginWidget;
import com.ibm.cloud.appid.android.api.tokens.AccessToken;
import com.ibm.cloud.appid.android.api.tokens.IdentityToken;
import com.ibm.cloud.appid.android.api.tokens.RefreshToken;
/**
* This class echoes a string called from JavaScript.
*/
public class ibmappidcordovaplugin extends CordovaPlugin {
//PluginResult result = null;
private CallbackContext callbackContext = null;
private static final String SHOW_AUTH = "authentication";
LoginWidget loginWidget;
loginWidget = AppID.getInstance().getLoginWidget();
public ibmappidcordovaplugin(){
AppID.getInstance().initialize(getApplicationContext(), "cdb1c3ab-e8cf-49cf-9dff-9dfa4bf2a898", AppID.REGION_US_SOUTH);
}
#Override
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
this.callbackContext = callbackContext;
String msg = args.getJSONObject(0).getString("msg");
if (action.equals("authentication")) {
//String message = args.getString(0);
this.coolMethod(msg, callbackContext);
return true;
}
return false;
}
private void coolMethod(String message, CallbackContext callbackContext) {
if (message != null && message.length() > 0) {
auth();
callbackContext.success(create());
} else {
callbackContext.error("Expected one non-empty string argument.");
}
}
private void auth(){
loginWidget.launch(this, new AuthorizationListener() {
#Override
public void onAuthorizationSuccess(final AccessToken accessToken, final IdentityToken identityToken,
RefreshToken refreshToken) {
cordova.getActivity().runOnUiThread(new Runnable() {
#Override
public void run() {
console.log("Name: " + identityToken.getName());
console.log("user: " + accessToken.getScope());
console.log("getIdentities " + identityToken.getIdentities());
console.log("getRaw " + identityToken.getRaw());
for (String name : identityToken.getAudience() ) {
console.log("AUD: " +name);
}
for (String name : identityToken.getAuthenticationMethods() ) {
console.log("AUTH: " +name);
}
try {
JSONObject ob = identityToken.getPayload();
console.log("getPayload " + ob.getString("preferred_username"));
}
catch (Exception e){
console.log("Error: " + e.getMessage());
}
}
});
}
#Override
public void onAuthorizationCanceled() {
}
#Override
public void onAuthorizationFailure (AuthorizationException exception) {
}
});
}
private String create(/*IdentityToken identityToken*/){
String response = "";
try {
JSONObject token = new JSONObject();
String t = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImFwcElkLWNkYjFjM2FiLWU4Y2YtNDljZi05ZGZmLTlkZmE0YmYyYTg5OC0yMDIwLTA5LTI1VDE1OjE5OjI4LjIxNyIsInZlciI6NH0.eyJpc3MiOiJodHRwczovL3VzLXNvdXRoLmFwcGlkLmNsb3VkLmlibS5jb20vb2F1dGgvdjQvY2RiMWMzYWItZThjZi00OWNmLTlkZmYtOWRmYTRiZjJhODk4IiwiYXVkIjpbIjc5NWUzMmVlZWFjMzIzMTM5YmM5ZWU3YmQ2NWEyMTc5YjNhNzc3ZjgiXSwiZXhwIjoxNjAyOTc2ODg0LCJ0ZW5hbnQiOiJjZGIxYzNhYi1lOGNmLTQ5Y2YtOWRmZi05ZGZhNGJmMmE4OTgiLCJpYXQiOjE2MDI5NzMyODQsImVtYWlsIjoiYW1hbmRvc0Bici5pYm0uY29tIiwibmFtZSI6IlZvbHVudGFyaW8gRmVsaXogZGEgVmlkYSIsInN1YiI6ImMyMjQ3ZWU3LTc3ZDEtNDFhMy04NjQ3LWRmNTNhMWMyMWJiMiIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiIxMjM0NTY3OCIsImdpdmVuX25hbWUiOiJWb2x1bnRhcmlvIiwiZmFtaWx5X25hbWUiOiJGZWxpeiBkYSBWaWRhIiwiaWRlbnRpdGllcyI6W3sicHJvdmlkZXIiOiJjbG91ZF9kaXJlY3RvcnkiLCJpZCI6IjU0NmU5NTk5LWJjMGItNDIxNi04YzljLTQ2N2RjZWQ5NjQ4NCJ9XSwiYW1yIjpbImNsb3VkX2RpcmVjdG9yeSJdfQ.C4_2mj3fx3IwfqH4_O8CR4NtSNpgR7WTbjOz9j1XvrAZS9uiTswMyCn9q8N8pIh6BuP2RTmBhAtnkjAYt0rkHOtEHutf9J79GkpN33-H5P-5k9pqopUuawyFZlfEuH3m76PVnH2XkDUZ1EOTRKrtuHIyYS74tGOYgF8r3hBwjSbFZPTchkNAQmqn5FTgJ6LzUa3xBWt3C1nkvMw3nKrorAUtrsCZXD9PGJKlqJhpZXH9renSRa4KDDwswHzhLGiIghgAmvVoNwOsUWrWbQF88EGDKAkyQRCnTRo2lqdANtYlIwsVitGc9zkje6wDOhjjfZ6g24sj9Id-kK7Sw813aQ";
token.put("name", "Fulando da Silva"/*identityToken.getName()*/);
token.put("email", "fulano#test.com"/*identityToken.getEmail()*/);
token.put("token", t/*identityToken.getRaw()*/);
response = token.toString();
} catch (JSONException e) {
throw new RuntimeException(e);
}
return response;
}
}

react-native-sensors Error: Native modules for sensors not available. Did react-native link run successfully?

Thanks for any help, getting error message "Error: Native modules for sensors not available. Did react-native link run successfully?" when running npx react-native start
npx react-native run-android gives this error: > Task :app:processDebugManifest FAILED
right after installing react-native-sensors.
Install procedure:
npx react-native init proj8
cd proj8
npm install react-native-sensors --save
npx react-native link react-native-sensors
The last command reported successful but when I went through the manual Android procedure some parts were not done as follows:
import com.sensors.RNSensorsPackage;
was in android/app/src/main/java/[...]/MainApplication.java
new RNSensorsPackage()
was not there, I added as follows:
#Override
protected List<ReactPackage> getPackages() {
#SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
packages.add(new RNSensorsPackage());
return packages;
}
include ':react-native-sensors'
project(':react-native-sensors').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sensors/android')
were both there in android/settings.gradle
dependencies {
implementation project(':react-native-sensors')
implementation fileTree(dir: "libs", include: ["*.jar"])
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
I had to add implementation project(':react-native-sensors')
I don't think my code matters yet but App.js:
import React, {useState, useEffect, useRef} from 'react';
import { StyleSheet,ScrollView,SafeAreaView,Platform, View,Text } from 'react-native';
export default function App() {
var Rndr =
<Text>asdf</Text>
return Rndr
}
package.json:
{
"name": "proj8",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"react": "16.13.1",
"react-native": "0.63.3",
"react-native-sensors": "^7.0.1"
},
"devDependencies": {
"#babel/core": "^7.8.4",
"#babel/runtime": "^7.8.4",
"#react-native-community/eslint-config": "^1.1.0",
"babel-jest": "^25.1.0",
"eslint": "^6.5.1",
"jest": "^25.1.0",
"metro-react-native-babel-preset": "^0.59.0",
"react-test-renderer": "16.13.1"
},
"jest": {
"preset": "react-native"
}
}
I encountered the same problem. This occurs because react-native-sensors has a minsdk version is 17 and react-native's default minsdk version is 16 Its quite easy to solve.
Just go to android/build.gradle
Change minSdkVersion to anything above 17
Before
ext {
buildToolsVersion = "29.0.2"
minSdkVersion = 16
compileSdkVersion = 29
targetSdkVersion = 29
}
After
ext {
buildToolsVersion = "29.0.2"
minSdkVersion = 19
compileSdkVersion = 29
targetSdkVersion = 29
}

How to create a multi-apps project in Ionic 4?

I try to create a simple multi-apps project in Ionic 4, following the ionic documentation, but it doesn't work.
https://ionicframework.com/docs/cli/configuration#multi-app-projects
My config :
Ionic : v4.12.0
Angular CLI : 7.3.8
Node : 10.15.1
npm : 6.9.0
Windows 10
What I have done :
I have created a directory “monorepo”.
In this folder, I created a file ionic.config.json and pasted in it the code below:
{
"projects": {}
}
In monorepo, I create a second directory : apps.
In this directory (with the command prompt), I write the command :
ionic start "app1" --no-deps
monorepo/ionic.config.json is correctly populated with the data:
{
"projects": {
"app1": {
"name": "app1",
"integrations": {},
"type": "angular",
"root": "apps\\app1"
}
}
}
But when I try to serve the server, it won't work.
ionic serve --project app1 return me this error message :
> ng run app1:serve --host=0.0.0.0 --port=8100
[ng] Project 'app1' could not be found in workspace.
[ng] Error: Project 'app1' could not be found in workspace.
[ng] at Workspace.getProject (C:\Users\name\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\#angular-devkit\core\src\workspace\workspace.js:93:19)
[ng] at Architect.getBuilderConfiguration (C:\Users\name\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\#angular-devkit\architect\src\architect-legacy.js:117:41)
[ng] at RunCommand.runSingleTarget (C:\Users\name\AppData\Roaming\npm\node_modules\#angular\cli\models\architect-command.js:160:45)
[ng] at RunCommand.runArchitectTarget (C:\Users\name\AppData\Roaming\npm\node_modules\#angular\cli\models\architect-command.js:201:35)
[ng] at RunCommand.run (C:\Users\name\AppData\Roaming\npm\node_modules\#angular\cli\commands\run-impl.js:14:25)
[ng] at RunCommand.validateAndRun (C:\Users\name\AppData\Roaming\npm\node_modules\#angular\cli\models\command.js:124:31)
[ng] at process._tickCallback (internal/process/next_tick.js:68:7)
[ng] at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
[ng] at startup (internal/bootstrap/node.js:283:19)
[ng] at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
[ERROR] ng has unexpectedly closed (exit code 1).
The Ionic CLI will exit. Please check any output above for error details.
When I go under the file associated with the error (workspace.js:93:19), and I do console.log, I obtain this info:
getProject(projectName) {
this._assertLoaded();
console.log("this.projectName : " + projectName); // this.projectName : app1
console.log("\n\nthis._workspace.projects : \n");
console.log(this._workspace.projects); // this._workspace.projects : app and app-e2e
const workspaceProject = this._workspace.projects[projectName];
(Values displayed are in comments).
The projectName variable seems ok. But the available project in this._workspace.projects are app and app-e2e which seem weird.
What is my problem ?
What did I miss ?
I managed to compile by replacing in the angular.json every app keyword by the name of my ionic project (here, app1).
{
"$schema": "./node_modules/#angular-devkit/core/src/workspace/workspace-schema.json",
"version": 1,
"defaultProject": "app1", <-- HERE
"newProjectRoot": "projects",
"projects": {
"app1": { <-- HERE
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app1", <-- NOT MANDATORY
"schematics": {},
"architect": {
"build": { ... },
"serve": {
"builder": "#angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "app1:build" <-- HERE
},
...
}
I suppose that instead of putting several angular apps within one project structure you should rewrite each ionic project's angular.json

error building `ionic-angular` app with `capacitor`

I'm trying to follow this tutorial: https://www.joshmorony.com/using-google-maps-and-geolocation-in-ionic-with-capacitor/
If I use the following steps to create the project
ionic start gmap3 blank --type=ionic-angular --no-link && cd ./gmap3
npm install #types/googlemaps --save-dev
ionic generate component GoogleMaps
npm run build # OK
# install capacitor
npm install --save #capacitor/cli #capacitor/core
# npm uninstall --save cordova-plugin-splashscreen
npx cap init gmap com.example.gmap
npm run build # ERROR after adding #capacitor/core
I get the following error AFTER I add capacitor the the project:
[11:19:12] transpile started ...
[11:19:16] typescript: node_modules/#types/node/index.d.ts, line: 194
Subsequent variable declarations must have the same type. Variable 'process' must be of type '{ env: { [key:
string]: string; }; }', but here has type 'Process'.
L193: interface RequireResolve {
L194: (id: string, options?: { paths?: string[]; }): string;
L195: paths(request: string): string[] | null;
[11:19:16] ionic-app-script task: "build"
[11:19:16] Error: Failed to transpile program
Error: Failed to transpile program
at new BuildError (/dev/ionic3/gmap3/node_modules/#ionic/app-scripts/dist/util/errors.js:16:28)
at /dev/ionic3/gmap3/node_modules/#ionic/app-scripts/dist/transpile.js:159:20
at new Promise (<anonymous>)
at transpileWorker (/dev/ionic3/gmap3/node_modules/#ionic/app-scripts/dist/transpile.js:107:12)
at Object.transpile (/dev/ionic3/gmap3/node_modules/#ionic/app-scripts/dist/transpile.js:64:12)
at /dev/ionic3/gmap3/node_modules/#ionic/app-scripts/dist/build.js:109:82
at <anonymous>
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gmap3#0.0.1 build: `ionic-app-scripts build`
npm ERR! Exit status 1
But I can clone a github repo (modified with the same package.json) and it builds fine. see: https://github.com/mixuala/ionic3-gmaps.git
git clone https://github.com/mixuala/ionic3-gmaps.git gmap3.2
cd gmap3.2
npm install
npm run build
why is that???
Here is the package.json:
"dependencies": {
"#angular/animations": "5.2.11",
"#angular/common": "5.2.11",
"#angular/compiler": "5.2.11",
"#angular/compiler-cli": "5.2.11",
"#angular/core": "5.2.11",
"#angular/forms": "5.2.11",
"#angular/http": "5.2.11",
"#angular/platform-browser": "5.2.11",
"#angular/platform-browser-dynamic": "5.2.11",
"#capacitor/cli": "^1.0.0-beta.7",
"#capacitor/core": "^1.0.0-beta.7",
"#ionic-native/core": "~4.12.0",
"#ionic-native/splash-screen": "~4.12.0",
"#ionic-native/status-bar": "~4.12.0",
"#ionic/storage": "2.1.3",
"ionic-angular": "3.9.2",
"ionicons": "3.0.0",
"rxjs": "5.5.11",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.26"
},
"devDependencies": {
"#ionic/app-scripts": "^3.2.0",
"#types/googlemaps": "^3.30.12",
"typescript": "~2.6.2"
},
This is a known issue in the #ionic/cli repo. Please see #3541.
It can be solved adding "types": [] to the "compilerOptions" parameter of the file tsconfig.json.

could not find cucumber plugin for protractor test

i am brand new to protractor and did setup as per the instructions from the protractor website. When i try to run the protractor test with the a cucumber framework i always get "Error: Error: Cannot find module 'cucumber'". Any help on this? below are by configurations.
cucumber-conf.js
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
capabilities: {
browserName:'chrome'
},
framework: 'custom',
frameworkPath: require.resolve('protractor-cucumber-framework'),
specs: [
'./cucumber/*.feature'
],
cucumberOpts: {
require: ['./cucumber/*.js'],
tags: [],
strict: true,
format: ["pretty"],
dryRun: false,
compiler: []
},
onPrepare: function () {
browser.manage().window().maximize();
}
};
when i run protractor cucumber-conf.js i get below error.
/opt/protractor_tests
➔ protractor cucumber-conf.js
(node:5681) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[12:06:55] I/launcher - Running 1 instances of WebDriver
[12:06:55] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
[12:06:57] E/launcher - Error: Error: Cannot find module 'cucumber'
at Function.Module._resolveFilename (module.js:472:15)
at Function.Module._load (module.js:420:25)
at Module.require (module.js:500:17)
at require (internal/module.js:20:19)
at Object.module.exports.load (/opt/protractor_tests/node_modules/protractor-cucumber-framework/lib/cucumberLoader.js:5:12)
at Object.<anonymous> (/opt/protractor_tests/node_modules/protractor-cucumber-framework/index.js:5:48)
at Module._compile (module.js:573:32)
at Object.Module._extensions..js (module.js:582:10)
at Module.load (module.js:490:32)
at tryModuleLoad (module.js:449:12)
[12:06:57] E/launcher - Process exited with error code 100