Open rnmhdn opened 4 years ago
Is this repo dead? I've been having this issue for a month now and I have got no response... this repo has 17 contributors!!!
this is really sad.
@aranmohyeddin once again thank you for pinging the team on this one.
I can confirm that indeed the build scrip (npm run build
) is failing with
D:\rep\nativescript-facebook\src\node_modules\.bin\ngc:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
at new Script (vm.js:79:7)
at createScript (vm.js:251:10)
at Object.runInThisContext (vm.js:303:10)
at Module._compile (internal/modules/cjs/loader.js:657:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:283:19)
and npm run demo.android
is failing with
JS: HMR: Hot Module Replacement Enabled. Waiting for signal.
System.err: An uncaught Exception occurred on "main" thread.
System.err: Unable to start activity ComponentInfo{org.nativescript.demo/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Calling js method onCreate failed
System.err: Error: The SDK has not been initialized, make sure to call FacebookSdk.sdkInitialize() first.
System.err: com.facebook.internal.Validate.sdkInitialized(Validate.java:144)
System.err: com.facebook.FacebookSdk.getApplicationContext(FacebookSdk.java:577)
System.err: com.facebook.internal.FetchedAppGateKeepersManager.loadAppGateKeepersAsync(FetchedAppGateKeepersManager.java:87)
System.err: com.facebook.internal.FeatureManager.checkFeature(FeatureManager.java:36)
System.err: com.facebook.appevents.internal.ActivityLifecycleTracker.startTracking(ActivityLifecycleTracker.java:72)
System.err: com.facebook.FacebookSdk.setAutoLogAppEventsEnabled(FacebookSdk.java:919)
System.err: com.tns.Runtime.callJSMethodNative(Native Method)
System.err: com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1209)
System.err: com.tns.Runtime.callJSMethodImpl(Runtime.java:1096)
System.err: com.tns.Runtime.callJSMethod(Runtime.java:1083)
System.err: com.tns.Runtime.callJSMethod(Runtime.java:1063)
System.err: com.tns.Runtime.callJSMethod(Runtime.java:1055)
System.err: com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:19)
@NickIliev Thank you. I've asked this question on stackoverflow. And someone tried to help but I failed to understand what they told me to do, maybe you can use that information to solve this.
@aranmohyeddin not quite sure what is happening in the SO thread but there seems to be an issue with the latest version of the plugin which is causing the npm run demo.android
to fail (this is the command that executes the demo). Once the fix is released I will ping you so that you could test with the newer version.
@aranmohyeddin there are few things that are wrong here - in the following lines I will explain what is happening and how to fix the development workflow with this plugin on Windows.
There was a bug in the plugin which was resolved via this PR. So in order for the demo to work make sure you've pulled the latest changes from this branch (or use the newly published version which will be live in a matter of few hours)
Then we are coming to the npm run build
issue that is reproducible on Windows. The thing is that the script is calling an Angular specific ngc
script. Here is what we have behind npm run build
"build": "npm i && tsc && tns plugin build && npm run ngc",
The last part is failing due to some syntax error when executing bash commands on Windows. The thing is that the npm run is not executing the proper command (onWindows the executable ngx.cmd should be triggered instead of the bash script). So to resolve the issue remove the last part from the build command.
"build": "npm i && tsc && tns plugin build",
Then update the Angular dependencies to version 8.2.x and the TypeScript dependency to 3.4.5
"devDependencies": {
"tns-core-modules": "^6.1.2",
"tns-platform-declarations": "^6.1.2",
"typescript": "~3.4.5",
"nativescript-angular": "~8.2.0",
"nativescript-vue": "~2.2.0",
"@angular/core": "~8.2.0",
"@angular/common": "~8.2.0",
"@angular/compiler": "~8.2.0",
"@angular/compiler-cli": "~8.2.0",
"rxjs": "^6.3.3",
"zone.js": "~0.8.26",
"tslint": "~5.11.0"
}
Remove node_modules and re-run the command
npm run build
After that manually execute the Angular ngc command as follows:
./node_modules/.bin/ngc
Now you are good to go with starting the demo
cd ../demo
rm -rf node_modules platforms
cd ../src
npm run demo.android
I'm not on windows. I'm on Archlinux. I don't just want to run the demo. I want to use the actual plugin in my app. In The SO question I've posted the error I get in the actual plugin.
Please, tell us how to recreate the issue in as much detail as possible.
I did exactly as stated in the vue demo directory.
Here is the content of the 387Z-debug.log file:
Here is the content of the 407Z-debug.log file: