Getting error while building ConnectyCube javascript demo app - javascript

I am developing a dating app in NativeScript angular. I want to add connectycube messaging plugin in my project. I got a demo app which is in JavaScript from GitHub repository. When I try to run it, it throws an error :
ERROR in ../node_modules/nativescript-connectycube/lib/videocalling_conference/cubeConferenceClient.js 12:21
Module parse failed: Unexpected token (12:21)
You may need an appropriate loader to handle this file type.
DEVICE_INPUT_TYPES = DEVICE_INPUT_TYPES
CALL_TYPES = CALL_TYPES
# ../node_modules/nativescript-connectycube/lib/cubeMain.js 49:31-88
# ./services/connectycube-service.js
# ./app.js
# multi #babel/polyfill ./app.js
If I just add this plugin in my project and build, it always throws the same error. How do I solve it?

You should add '#babel/plugin-proposal-class-properties'

Related

React with AWS - Error: html-webpack-plugin could not minify the generated output

When I deploy the contents of my build folder to my S3 bucket, I get this error below each time. The app builds fine when I run npm build, and it works when I run npm start. I created another app following the generic create-react-app tutorial, and that worked fine when I deployed it to AWS.
Error: html-webpack-plugin could not minify the generated output.
In production mode the html minifcation is enabled by default.
If you are not generating a valid html output please disable it manually.
You can do so by adding the following setting to your HtmlWebpackPlugin config:
|
| minify: false
|
See https://github.com/jantimon/html-webpack-plugin#options for details.
For parser dedicated bugs please create an issue here:
https://danielruf.github.io/html-minifier-terser/
Parse Error: React App
- htmlparser.js:244 new HTMLParser
[Accrescent]/[html-minifier-terser]/src/htmlparser.js:244:13
- htmlminifier.js:993 minify
[Accrescent]/[html-minifier-terser]/src/htmlminifier.js:993:3
- htmlminifier.js:1354 Object.exports.minify
[Accrescent]/[html-minifier-terser]/src/htmlminifier.js:1354:16
- index.js:1013 HtmlWebpackPlugin.minifyHtml
[Accrescent]/[html-webpack-plugin]/index.js:1013:46
- index.js:429 HtmlWebpackPlugin.postProcessHtml
[Accrescent]/[html-webpack-plugin]/index.js:429:40
- index.js:254
[Accrescent]/[html-webpack-plugin]/index.js:254:25
- task_queues.js:93 processTicksAndRejections
internal/process/task_queues.js:93:5```

How to fix Error #10123 when I run gatsby develop for gatsby-starter-gcn?

I'm trying to use gatsby-starter-gcn to create a website. At this point I just want to be able to view the starter site locally so I can begin to make edits. But when I run gatsby develop I get the following error:
ERROR #10123 CONFIG
We encountered an error while trying to load your site's gatsby-config. Please fix the error and try again.
Error: Contentful space ID and access token need to be provided.
- gatsby-config.js:14 Object.<anonymous>
C:/Windows/system32/gatsby-starter-gcn/gatsby-config.js:14:11
- v8-compile-cache.js:178 Module._compile
[gatsby-starter-gcn]/[v8-compile-cache]/v8-compile-cache.js:178:30
- loader.js:1220 Object.Module._extensions..js
internal/modules/cjs/loader.js:1220:10
- loader.js:1049 Module.load
internal/modules/cjs/loader.js:1049:32
- loader.js:937 Function.Module._load
internal/modules/cjs/loader.js:937:14
- loader.js:1089 Module.require
internal/modules/cjs/loader.js:1089:19
- v8-compile-cache.js:159 require
[gatsby-starter-gcn]/[v8-compile-cache]/v8-compile-cache.js:159:20
- get-config-file.js:33 getConfigFile
[gatsby-starter-gcn]/[gatsby]/dist/bootstrap/get-config-file.js:33:20
- index.js:134 module.exports
[gatsby-starter-gcn]/[gatsby]/dist/bootstrap/index.js:134:46
- develop-process.js:433 module.exports
[gatsby-starter-gcn]/[gatsby]/dist/commands/develop-process.js:433:36
- task_queues.js:97 processTicksAndRejections
internal/process/task_queues.js:97:5
not finished open and validate gatsby-configs - 0.052s
I tried to open the gatsby-config.js file in order to see the problem. I could open it in Notepad just fine, but Windows Script Host returned this error:
Line: 1
Char: 5
Error: Expected ';'
Code: 800A03EC
Source: Microsoft JScript compilation error
I think if I can fix this compilation error in this file my problem will probably be fixed, but I haven't been able to figure out how, since I'm not terribly experienced with javascript. Here's a link to the file on GitHub: https://github.com/ryanwiemer/gatsby-starter-gcn/blob/master/gatsby-config.js
It looks like the error is being thrown because you may not have a .env file in your repository or windows environment variables set with your contentful SPACE_ID, ACCESS_TOKEN.
https://github.com/ryanwiemer/gatsby-starter-gcn/blob/master/gatsby-config.js#L7
Creating those variables should get this building for you.
I believe you need an .env file with SPACE_ID and ACCESS_TOKEN at the root of your project.
The project requires a .contentful.json config file to be created in the root of the project. You can run npm run setup or yarn setup to have it walk you through the creation with you providing Contentful API key info. After that, running gatsby develop should work fine.

Reference error from react inside meteor only when minified

I'm using react inside a meteor app. It works fine when running in development mode, but when I run it in production mode and the code is minified, I get the below ReferenceError and minified react error in the browser console when the app loads. The same thing happens when I try to deploy it.
It's being minified using the built in standard-minifier-js. When I meteor remove this package, it works fine, so it's definitely the minification.
I'm stumped. I know that the line in question is part of react-dom, but I can't figure out which part or why it's only throwing an error after minification.
The react error decoder says:
Should have found an error boundary. This error is likely caused by a bug in React. Please file an issue.
Which isn't much more helpful. Any ideas what could be causing the error, or how to troubleshoot it? I'm using the latest versions of everything, AFAICT:
react version: 16.0.0
meteor version: 1.5.2.2
standard-minifier-js version: 2.1.2
Thanks.
b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:5149 ReferenceError: av is not defined
at b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:4003
at sv (b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:4107)
at dv (b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:4104)
at beginWork (b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:4243)
at ov (b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:4941)
at fv (b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:4976)
at lv (b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:5028)
at mv (b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:5182)
at bv (b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:5164)
at Object.updateContainer (b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:8400)
pv # b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:5149
lv # b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:5042
mv # b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:5182
bv # b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:5164
updateContainer # b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:8400
(anonymous) # b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:5603
unbatchedUpdates # b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:5258
Dr # b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:5602
render # b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:8559
(anonymous) # b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:93855
s # b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:315
u # b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:321
b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:3148 Uncaught Error: Minified React error #183; visit http://facebook.github.io/react/docs/error-decoder.html?invariant=183 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at ot (b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:3148)
at lv (b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:5043)
at mv (b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:5182)
at bv (b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:5164)
at Object.updateContainer (b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:8400)
at b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:5603
at Object.unbatchedUpdates (b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:5258)
at Dr (b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:5602)
at render (b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:8559)
at b2413faf75d38415b6ec79874ae1bd18fb0a8af3.js?meteor_js_resource=true:formatted:93855
I tried another minification package, uglifyjs2, instead of standard-minifier-js and that appears to have worked. But it seems like there's a bug here with either react or meteor.
meteor remove standard-minifier-js
meteor add ssrwpo:uglifyjs2

jarsigner: unable to sign jar: java.util.zip.ZipException: duplicate entry: org/appcelerator/titanium/gen/bindings.json

I am facing issue while using custom module in titanium application:-
[ERROR] : Failed to sign apk:
[ERROR] : jarsigner: unable to sign jar: java.util.zip.ZipException: duplicate entry: org/appcelerator/titanium/gen/bindings.json
I have created new custom module for android and I am trying to use this module in my application but at run time I am getting above error.
I didn't get any solution yet please share if anyone have any idea related to this issue.
Thanks
Long discussion regarding this error on the Appc JIRA (https://jira.appcelerator.org/browse/TIMOB-23502)
From the PR (https://github.com/appcelerator/titanium_mobile/pull/8551) looks like you will have to wait until 6.1.0 for the fix, or build a new sdk from master, or cherry pick the fixes into your current SDK.
In the discussion, Sean Conway offered a solution (https://jira.appcelerator.org/browse/TIMOB-23502?focusedCommentId=393172&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-393172) that worked for some folks, but not others.
I was able to remove the gen/bindings.json file by doing the following:
(1) Set Java Compiler to 1.8
(2) Update build.properties:
titanium.platform=/Users/xxx/Library/Application Support/Titanium/mobilesdk/osx/5.4.0.GA/android
android.platform=/Users/xxx/Library/android-sdk-macosx/platforms/android-23
android.ndk=/Users/xxx/android-sdks/build-tools/22.0.1/android-ndk-r10e
(3) Change all libraries in build path to use 5.4.0.GA JARS
(4) Delete build and dist folders then rebuild using ANT *** WIll not work otherwise, still produces gen file if you package-->android module
DO not use package option to build, go to build.xml, right click-->Run as Ant Build
Successful project build

Module 'smart-table' is not available

I am trying to get started with a smart-table. I am following the instructions available here: http://lorenzofox3.github.io/smart-table-website/
So according to those instructions all I need to do is run, bower install angular-smart-table and then add then add the module angular.module('myApp',['smart-table'] to your angular application. Here's my angular application:
# pwd
/var/www/html
# cat meanVoyApp.js
var app = angular.module("meanVoyApp", ['smart-table']);
But now when I load my markup I get these errors in my browsers console:
Uncaught Error: [$injector:modulerr] Failed to instantiate module meanVoyApp due to:
Error: [$injector:modulerr] Failed to instantiate module smart-table due to:
Error: [$injector:nomod] Module 'smart-table' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.3.14/$injector/nomod?p0=smart-table
I didn't misspell so I guess I "forgot" to load it. So how do I load it? How can I tell if it is already loaded and something else is the problem?
Thanks!
Did you remember to add a reference to the script in your index.html?
<script src="[directoryOfModule]/smart-table.js"></script>
Smart-table comes with some js file. I think you are not loading that before to your meanVoyApp.js load. Use chrome developer tool network panel to identify the java-script are properly loaded nor not.
Use the following code before your app.js load
<script src="http://lorenzofox3.github.io/smart-table-website/bower_components/angular-smart-table/dist/smart-table.js"></script>
Use
bower install angular-smart-table --save
and some good gulp or grunt build tool configuration (e.g. yeoman) will automatically add it to your index.html.
Take a look at your build process.
In case you use ngBoilerplate kickstarter, you need to add the following line:
'vendor/angular-smart-table/dist/smart-table.min.js'
inside vendor_files section of build.config.js file.

Categories

Resources