I am trying to add the nativescript-telerik-ui and use the side drawer in a blank project. The project builds properly, but I am getting the error shown below if I try to run the code on a connected device:
The project was running correctly until I tried to use the drawer on one of the pages.
Here is my package.json:
{
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"readme": "NativeScript Application",
"repository": "<fill-your-repository-here>",
"nativescript": {
"id": "org.nativescript.drawertest",
"tns-android": {
"version": "2.4.1"
}
},
"dependencies": {
"nativescript-telerik-ui": "^1.5.1",
"nativescript-theme-core": "^0.2.1",
"tns-core-modules": "2.4.4"
},
"devDependencies": {
"babel-traverse": "6.21.0",
"babel-types": "6.21.0",
"babylon": "6.14.1",
"lazy": "1.0.11",
"nativescript-dev-android-snapshot": "^0.*.*"
}
}
I also tried running it in Genymotion. Here is the error I am getting there:
An uncaught Exception occurred on "main" thread.
java.lang.RuntimeException: Unable to start activity ComponentInfo{org.nativescript.drawertest/com.tns.NativeScriptActivity}: com.tns.NativeScriptException:
Calling js method onCreate failed
Error: Building UI from XML. #file:///app/main-page.xml:20:5
> Module 'ui/rad-side-drawer' not found for element 'RadSideDrawer'.
> com.tns.NativeScriptException: Failed to find module: "ui/rad-side-drawer", relative to: app/tns_modules/
com.tns.Module.resolvePathHelper(Module.java:159)
com.tns.Module.resolvePath(Module.java:60)
com.tns.Runtime.callJSMethodNative(Native Method)
com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1022)
com.tns.Runtime.callJSMethodImpl(Runtime.java:907)
com.tns.Runtime.callJSMethod(Runtime.java:895)
com.tns.Runtime.callJSMethod(Runtime.java:879)
com.tns.Runtime.callJSMethod(Runtime.java:871)
com.tns.NativeScriptActivity.onCreate(android.app.Activity.java)
android.app.Activity.performCreate(
I should probably mention that I getting similar error when I am trying to run the same code on my mac using the ios emulator.
What am I missing?
Thank you.
EDIT: It turns out I had a syntax error. Once corrected, everything worked as expected.
From the error log it looks like you have declared an incorrect namespace for the RadSideDrawer component ("ui/rad-side-drawer"). That component is part of the nativescript-telerik-ui plugin which can be found in the nativescript-telerik-ui-pro/sidedrawer module in the node_modules folder.
For more details you can take a look at the official documentation here.
Simply declare this namespace and use it when declaring the RadSideDrawer in the XML:
xmlns:drawer="nativescript-telerik-ui-pro/sidedrawer"
Related
Learner and keep getting "Step implementation missing for: I open Google page" error.
Here is my repo https://github.com/PatoDeVille/TsBDDtest.git
Checked the documentation here https://www.npmjs.com/package/cypress-cucumber-preprocessor#cypress-configuration and all seems okay.
The tutorial I am following is https://www.youtube.com/watch?v=ZM7bzu0zIT8
Also checked the problem in Cypress.io and Cucumber.io testing integration, Step implementation missing for: and the bug is still present
/package.json devDependencies
{
"browserify": "^16.2.3",
"cypress": "^7.3.0",
"cypress-cucumber-preprocessor": "^4.1.0",
"node-static": "^0.7.11",
"typescript": "^2.9.2"
}
/cypress.json
{
"testFiles": "**/*.feature"
}
/.cypress-cucumber-preprocessorrc.json
{
"nonGlobalStepDefinitions": true,
"step_definitions": "cypress/support/step_definitions/"
}
If you specified in the following way
"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": true
}
cypress will check for your test definitions inside the integration folder but if you want to change the location outsite the integration file folder you should set it as the following way (define the nonGlobalStepDefinitions as false and define the stepDefinitions file folder)
"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": false,
"stepDefinitions": "cypress/stepsDefinition"
}
it should work, here I attach you an example of my structure
I am trying to clone an application, which is given in their document under canvas API section. They have given an option for sample walkthrough [https://developers.google.com/actions/interactivecanvas/sample-walkthrough]. I have followed every step but I am getting an error that my intents are not handled.
You can see the code at [github.com/actions-on-google/dialogflow-snowman-nodejs.git].
I have tried seeing all the intent handlers, Also, i have tried changing all the packages to the lastest one, as i have mentioned in the question.
I am using following packages:
{
"name": "snowman-canvas-sample-functions",
"description": "Snowman Actions on Google Interactive Canvas Sample Functions",
"license": "Apache-2.0",
"private": true,
"engines": {
"node": "8"
},
"dependencies": {
"actions-on-google": "preview",
"firebase-admin": "~5.13.1",
"firebase-functions": "^2.0.2"
},
"scripts": {
"lint": "./node_modules/.bin/eslint --fix \"**/*.js\"",
"start": "firebase serve --only functions",
"deploy": "firebase deploy --only functions",
"test": "npm run lint"
},
"devDependencies": {
"eslint": "^6.0.1",
"eslint-config-google": "^0.13.0"
}
}
i am getting "Dialogflow IntentHandler not found for intent: Welcome at Function" error in the welcome intent itself. Please assist me what should i try next.
You need to make sure your Dialogflow intent name and your Firebase Function intent handler name are the same.
From here, you'd need to implement a handler:
const { dialogflow } = require('actions-on-google')
const app = dialogflow()
app.intent('Welcome', conv => {
conv.ask('Welcome!')
})
I am using Shoutem and have tried running 'react-native run-ios' and running the xcode workspace file directly. Using both gives this error (I realize Restaurants is misspelled):
Loading dependency graph...(node:22499) UnhandledPromiseRejectionWarning: Error: jest-haste-map: #providesModule naming collision:
Duplicate module name: user.resturants
Paths: /Users/USERNAME/Resturaunts/user.resturants/server/package.json collides with /Users/USERNAME/Resturaunts/user.resturants/app/package.json
This error is caused by a #providesModule declaration with the same name across two different files.
at setModule (/Users/USERNAME/Resturaunts/node_modules/jest-haste-map/build/index.js:446:17)
at workerReply (/Users/USERNAME/Resturaunts/node_modules/jest-haste-map/build/index.js:496:9)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:19894) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:19894) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
error: bundling failed: Error: jest-haste-map: #providesModule naming collision:
Duplicate module name: user.resturants
Paths: /Users/USERNAME/Resturaunts/user.resturants/server/package.json collides with /Users/USERNAME/Resturaunts/user.resturants/app/package.json
This error is caused by a #providesModule declaration with the same name across two different files.
at setModule (/Users/USERNAME/Resturaunts/node_modules/jest-haste-map/build/index.js:446:17)
at workerReply (/Users/USERNAME/Resturaunts/node_modules/jest-haste-map/build/index.js:496:9)
at process._tickCallback (internal/process/next_tick.js:68:7)
BUNDLE [ios, dev] ../../index.js ░░░░░░░░░░░░░░░░ 0.0% (0/1), failed.
I have tried following the steps shown here and I still run into the same problem.
Using 'react-native run-ios' also shows this error in the terminal. I am unsure if this is related.
The following commands produced analyzer issues:
Analyze /Users/USERNAME/Resturaunts/node_modules/react-native/React/Base/RCTModuleMethod.mm normal x86_64
Analyze /Users/USERNAME/Resturaunts/node_modules/react-native/React/Base/RCTUtils.m normal x86_64
(2 commands with analyzer issues)
Installing build/Build/Products/Debug-iphonesimulator/Resturaunts.app
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=164):
Unable to lookup in current state: Shutdown
Launching com.shoutem.ShoutemApp
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=164):
Unable to lookup in current state: Shutdown
The build does succeed but the simulator shows nothing. I have also tried this solution here. I don't have enough experience to know what is going on. I have been trying to get this thing to work for a while now. This is the closest I have ever gotten to a working build.
Here is my package.json:
{
"name": "#shoutem/platform",
"version": "1.7.1-rc.0",
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"setup": "cd scripts && yarn install",
"lint": "eslint .",
"configure": "node scripts/configure",
"bundle": "node scripts/bundle",
"build": "node scripts/build"
},
"dependencies": {
"#shoutem/animation": "~0.12.2",
"#shoutem/core": "0.2.5",
"#shoutem/redux-composers": "0.1.4",
"#shoutem/redux-io": "3.0.1-beta.3",
"#shoutem/theme": "~0.11.2",
"#shoutem/ui": "0.23.6",
"#shoutem/ui-addons": "0.0.29",
"babel-preset-es2015": "~6.24.1",
"es6-symbol": "3.1.1",
"lodash": "~4.17.4",
"moment": "2.22.2",
"prop-types": "15.6.0",
"react": "16.4.1",
"react-native": "0.56.0",
"react-redux": "~5.0.2",
"redux": "~3.6.0",
"redux-action-buffer": "~1.0.1",
"redux-api-middleware": "2.0.1",
"redux-logger": "2.6.1",
"redux-persist": "4.1.0",
"redux-thunk": "~2.0.0",
"whatwg-fetch": "1.0.0",
"user.resturants": "https://extensions.static.shoutem.com/user/resturants/0.0.1/app.tgz?timestamp=1540222210009",
"shoutem.about": "https://extensions.static.shoutem.com/shoutem/about/1.7.1/app.tgz?timestamp=1532019904679",
"shoutem.analytics": "https://extensions.static.shoutem.com/shoutem/analytics/1.7.0/app.tgz?timestamp=1531924714589",
"shoutem.application": "https://extensions.static.shoutem.com/shoutem/application/1.7.0/app.tgz?timestamp=1531924719204",
"shoutem.auth": "https://extensions.static.shoutem.com/shoutem/auth/1.7.1/app.tgz?timestamp=1533647965562",
"shoutem.books": "https://extensions.static.shoutem.com/shoutem/books/1.7.0/app.tgz?timestamp=1531924805228",
"shoutem.camera": "https://extensions.static.shoutem.com/shoutem/camera/1.7.1/app.tgz?timestamp=1532513463813",
"shoutem.cms": "https://extensions.static.shoutem.com/shoutem/cms/1.7.0/app.tgz?timestamp=1531924864035",
"shoutem.code-push": "https://extensions.static.shoutem.com/shoutem/code-push/1.7.0/app.tgz?timestamp=1531924869983",
"shoutem.deals": "https://extensions.static.shoutem.com/shoutem/deals/1.7.2/app.tgz?timestamp=1531930828925",
"shoutem.events": "https://extensions.static.shoutem.com/shoutem/events/1.7.1/app.tgz?timestamp=1532513603690",
"shoutem.favorites": "https://extensions.static.shoutem.com/shoutem/favorites/1.7.1/app.tgz?timestamp=1531924890654",
"shoutem.flurry-analytics": "https://extensions.static.shoutem.com/shoutem/flurry-analytics/1.7.0/app.tgz?timestamp=1531925003203",
"shoutem.google-analytics": "https://extensions.static.shoutem.com/shoutem/google-analytics/1.7.0/app.tgz?timestamp=1531925048071",
"shoutem.i18n": "https://extensions.static.shoutem.com/shoutem/i18n/1.7.0/app.tgz?timestamp=1531926118452",
"shoutem.ical-events": "https://extensions.static.shoutem.com/shoutem/ical-events/1.7.1/app.tgz?timestamp=1532513791098",
"shoutem.layouts": "https://extensions.static.shoutem.com/shoutem/layouts/1.7.0/app.tgz?timestamp=1531925159116",
"shoutem.loyalty": "https://extensions.static.shoutem.com/shoutem/loyalty/1.7.7/app.tgz?timestamp=1534422589121",
"shoutem.menu": "https://extensions.static.shoutem.com/shoutem/menu/1.7.0/app.tgz?timestamp=1531925240759",
"shoutem.navigation": "https://extensions.static.shoutem.com/shoutem/navigation/1.7.1/app.tgz?timestamp=1534422615806",
"shoutem.news": "https://extensions.static.shoutem.com/shoutem/news/1.7.0/app.tgz?timestamp=1531925281565",
"shoutem.notification-center": "https://extensions.static.shoutem.com/shoutem/notification-center/1.7.0/app.tgz?timestamp=1531925287012",
"shoutem.page": "https://extensions.static.shoutem.com/shoutem/page/1.7.0/app.tgz?timestamp=1531925310994",
"shoutem.people": "https://extensions.static.shoutem.com/shoutem/people/1.7.0/app.tgz?timestamp=1531925316211",
"shoutem.persist": "https://extensions.static.shoutem.com/shoutem/persist/1.7.0/app.tgz?timestamp=1531925320758",
"shoutem.photos": "https://extensions.static.shoutem.com/shoutem/photos/1.7.0/app.tgz?timestamp=1531925325437",
"shoutem.places": "https://extensions.static.shoutem.com/shoutem/places/1.7.0/app.tgz?timestamp=1531925330220",
"shoutem.platform-analytics": "https://extensions.static.shoutem.com/shoutem/platform-analytics/1.7.0/app.tgz?timestamp=1531925334766",
"shoutem.preview": "https://extensions.static.shoutem.com/shoutem/preview/1.7.0/app.tgz?timestamp=1531925340045",
"shoutem.products": "https://extensions.static.shoutem.com/shoutem/products/1.7.0/app.tgz?timestamp=1531925346246",
"shoutem.push-notifications": "https://extensions.static.shoutem.com/shoutem/push-notifications/1.7.0/app.tgz?timestamp=1531925350876",
"shoutem.rss": "https://extensions.static.shoutem.com/shoutem/rss/1.7.0/app.tgz?timestamp=1531925392345",
"shoutem.rss-news": "https://extensions.static.shoutem.com/shoutem/rss-news/1.7.0/app.tgz?timestamp=1531925397913",
"shoutem.rss-photos": "https://extensions.static.shoutem.com/shoutem/rss-photos/1.7.0/app.tgz?timestamp=1531925402877",
"shoutem.rss-videos": "https://extensions.static.shoutem.com/shoutem/rss-videos/1.7.0/app.tgz?timestamp=1531925407618",
"shoutem.rubicon-theme": "https://extensions.static.shoutem.com/shoutem/rubicon-theme/1.7.2/app.tgz?timestamp=1534422920061",
"shoutem.shopify": "https://extensions.static.shoutem.com/shoutem/shopify/1.7.0/app.tgz?timestamp=1531925522991",
"shoutem.social": "https://extensions.static.shoutem.com/shoutem/social/1.7.0/app.tgz?timestamp=1531925590399",
"shoutem.sub-navigation": "https://extensions.static.shoutem.com/shoutem/sub-navigation/1.7.1/app.tgz?timestamp=1534423025262",
"shoutem.theme": "https://extensions.static.shoutem.com/shoutem/theme/1.7.0/app.tgz?timestamp=1531925600521",
"shoutem.video": "https://extensions.static.shoutem.com/shoutem/video/1.7.0/app.tgz?timestamp=1531925610624",
"shoutem.vimeo": "https://extensions.static.shoutem.com/shoutem/vimeo/1.7.0/app.tgz?timestamp=1531925661052",
"shoutem.web-view": "https://extensions.static.shoutem.com/shoutem/web-view/1.7.2/app.tgz?timestamp=1531925714059",
"shoutem.wordpress": "https://extensions.static.shoutem.com/shoutem/wordpress/1.7.0/app.tgz?timestamp=1531925779176",
"shoutem.youtube": "https://extensions.static.shoutem.com/shoutem/youtube/1.7.0/app.tgz?timestamp=1531925850488"
},
"devDependencies": {
"#shoutem/build-tools": "file:scripts/helpers",
"babel": "~6.3.26",
"babel-eslint": "~6.0.4",
"babel-jest": "23.2.0",
"babel-plugin-transform-decorators-legacy": "~1.3.4",
"babel-preset-react-native": "^5.0.1",
"eslint": "~2.9.0",
"eslint-config-airbnb": "~8.0.0",
"eslint-plugin-import": "~1.6.1",
"eslint-plugin-jsx-a11y": "~1.0.4",
"eslint-plugin-react": "~5.0.1",
"eslint-plugin-react-native": "~1.0.2",
"jest": "23.1.0",
"react-test-renderer": "16.4.1"
},
"jest": {
"preset": "react-native",
"transformIgnorePatterns": [
"node_modules/(?!react-native|#shoutem/theme|#shoutem/animation|#shoutem/ui)"
]
}
}
You are able to reproduce this by following the shoutem tutorial . I stopped at the linked part (setting local environment). I also got an error when running 'react-native run-ios' but solved it by following this
I have managed to add the AI dependencies and able to import/using in .csx files, but I'm not seeing any telemetry on the Application Insights resource.
All usage, Browser, Servers charts are empty except Failed requests and one custom event 'Activity'.
In my project.json I mentioned all AI dependencies like below:
{ "frameworks": {
"net46":{
"dependencies": {
"Microsoft.Bot.Builder.Azure": "3.1",
"Microsoft.ApplicationInsights": "2.1.0",
"Microsoft.ApplicationInsights.Agent.Intercept": "1.2.1",
"Microsoft.ApplicationInsights.Azure.WebSites": "2.1.3",
"Microsoft.ApplicationInsights.DependencyCollector": "2.1.0",
"Microsoft.ApplicationInsights.PerfCounterCollector": "2.1.0",
"Microsoft.ApplicationInsights.TraceListener": "2.1.0",
"Microsoft.ApplicationInsights.Web": "2.1.0",
"Microsoft.ApplicationInsights.WindowsServer": "2.1.0",
"Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel": "2.1.0",
"Microsoft.Web.Infrastructure": "1.0.0.0"
}
}
}
}
Then I tried to use a method like below in the Dialog class under MessageReceivedAsync:
await context.PostAsync($"{this.count++}: You said {message.Text}");
TelemetryClient telemetry = new TelemetryClient();
telemetry.TrackEvent("MessageReceivedAsync");
context.Wait(MessageReceivedAsync);
Can anyone help with implementing it?
Here's a reference to a working sample using Application Insights.
https://github.com/christopheranderson/azure-functions-app-insights-sample/tree/master/cs-http
I hope this helps!
I have a cli app written in coffee-script. The cli app uses commander (https://github.com/tj/commander.js) to take arguments. I have three files in my bin dir:
mediatidy
mediatidy-config
mediatidy-media
If I run bin/mediatidy in the project folder in bash commander executes fine. If I type bin/mediatidy config or bin/mediatidy media in bash commander also executes fine and is waiting for an <action>.
The odd thing is I published the project to npm and get different results when installed globally. If I install the project via sudo npm mediatidy -g (I am using Mac OSX 10.10) I can see the following files in /usr/local/bin/:
mediatidy
mediatidy-config
mediatidy-media
If I run bin/mediatidy in the project folder in bash commander executes fine. If I type bin/mediatidy config or bin/mediatidy media in bash I get the following error:
mediatidy config
/usr/local/lib/node_modules/mediatidy/bin/mediatidy-config:3
program = require 'commander'
^^^^^^^^^^^
SyntaxError: Unexpected string
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
Looks like a coffeescript compilation error... wat.
If I run the same command but with the dash, bin/mediatidy-config, it works fine. I have another app that is private that works without having to use the dash that is globally installed. What am I missing here?
edit: added my package.json file:
package.json:
{
"preferGlobal": true,
"main": "index",
"name": "mediatidy",
"description": "Keep your media nice and tidy!",
"version": "0.1.1",
"repository": {
"type": "git",
"url": "git#github.com:tkdan235/mediatidy.git"
},
"engines": {
"node": ">=0.10.0"
},
"directories": {
"bin": "bin",
"lib": "lib"
},
"dependencies": {
"async": "^0.9.0",
"coffee-script": "^1.8.0",
"colors": "^0.6.2",
"commander": "^2.1.0",
"fs-extra": "^0.11.1",
"lodash": "^2.4.1",
"nconf": "^0.7.1",
"node-dir": "^0.1.6",
"node-ffprobe": "^1.2.2",
"prompt": "^0.2.14",
"sqlite3": "^2.2.7"
},
"coffeelintConfig": {
"max_line_length": {
"name": "max_line_length",
"value": 120,
"level": "error",
"limitComments": true
}
}
}
This actually appears to be a limitation of Commander.js. At first glance, it doesn't appear to call the scripts as shell scripts. Instead, it calls them with node which won't be compiling the CoffeeScript code. See https://github.com/tj/commander.js/blob/master/index.js#L447-L479 (line 469 in particular).
Update:
After some further digging, it looks like this WAS once supported and working. The way sub-commands were called was just their script name. Then this pull request broke it: https://github.com/tj/commander.js/pull/173. The last working version for this behavior was in 2.1.0. You could pin your version to 2.1.0 to get this behavior back.