I am using Plovr to compile my javascript with this config file.
// File: config.js
{
"debug": true,
"id": "myfirstapp",
"paths": ".",
"inputs": "main.js",
"level": "VERBOSE",
"mode": "ADVANCED",
"pretty-print": true
}
Strangely, my app works, but I am consistently getting these 2 errors in Chrome Console.
GET http://www.myunreleasedapp.com/deps.js 404 (NOT FOUND) a.js:181
Uncaught TypeError: Cannot read property 'debug' of undefined
I examined the second error and discovered that the property Params.settings is undefined, so calling Params.settings.debug produces this error. However, I am not sure where in my Closure code to resolve either of these two errors. Any advice on what to look out for in my code?
The second error (Uncaught TypeError: Cannot read property 'debug' of undefined
) oddly occurs on this really long line in 58852.user.js:
saveSettings();Extend(that,Params);Params.enabled=
(Registry.getKey("enabled","enabled")=="enabled"?true:false);Params.isPage=
(getFromId("jewelFansTitle")?
true:false);Params.debug=Params.settings.debug;try{Params.iFrame=
(window.top!=self)}catch(exception){new ErrorHandler(exception)}try{if(Params.mobile)
{Params.mobileId=getFromId("m_user_DEPRECATED").value}}catch(exception){new
ErrorHandler(exception)}function trace(){if(!Params.dev)
{return}try{if(!traced[arguments.callee.caller.name]){traced[arguments.callee.caller.name]=0
Again, Params.settings seems to be undefined. This is a Facebook app, so I think this code may be relevant to Facebook.
Related
This does not appear to break anything that I can see but when I dismiss an Infobar the below is logged.
week:1
Refused to run the JavaScript URL because it violates the following Content Security Policy directive: "script-src 'nonce-aBqgvw/jWGVEtnMFOtR0XQ==' *.res.office365.com *.fluidpreview.office.net *.cdn.office.net wss://*.delve.office.com:443 shellprod.msocdn.com amcdn.msauth.net amcdn.msftauth.net *.bing.com *.skype.com *.skypeassets.com *.delve.office.com *.cdn.office.net static.teams.microsoft.com *.googleapis.com teams.microsoft.com cdn.forms.office.net blob: 'report-sample' 'self' 'wasm-unsafe-eval' *.yammer.com". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution. Note that hashes do not apply to event handlers, style attributes and javascript: navigations unless the 'unsafe-hashes' keyword is present.
owa.Addins.js:2
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'toString')
at owa.Addins.js:2:961463
at Array.filter (<anonymous>)
at _e (owa.Addins.js:2:961438)
at $e (owa.Addins.js:2:92056)
at owa.Addins.js:2:92197
at u (owa.ven.extframework.js:2:245162)
at m (owa.74191.js:1:5364)
at Ln (owa.ven.extframework.js:2:73851)
at l (owa.ven.extframework.js:2:245026)
at a (owa.ven.extframework.js:2:243749)
Sample code that generated the Infobar:
Office.context.mailbox.item.notificationMessages.replaceAsync(
"status",
{
type: Office.MailboxEnums.ItemNotificationMessageType.ErrorMessage,
message: "Test error message",
},
I am working on an automation prototype using Nightwatch js and when I am trying to save screenshot, it is giving below error
Error while running .getScreenshot() protocol action: An unknown
server-side error occurred while processing the command. – An unknown
server-side error occurred while proces...
TEST FAILURE: 1 error during execution; 0 tests failed, 0 passed
(10.032s)
TypeError: The "data" argument must be of type string or an instance
of Buffer, TypedArray, or DataView. Received an instance of Object
at Object.writeFile (fs.js:1487:5)
at FSReqCallback.oncomplete (fs.js:180:23)
FAILED: 1 errors and 1 passed (9.662s)
relevant data for nightwatch.config.js:
test_settings: {
"screenshots": {
"enabled": true, // if you want to keep screenshots
"path": './screenshots' // save screenshots here
},
test file data:
.pause(3000).saveScreenshot('./screnshots/test.png');
Nightwatch version: "1.5.1"
please note that due to office policy cannot paste complete testcase data here.
Everything worked fine, until I started to get this error when I use "ask dialog":
Error: This utterance did not resolve to any intent in your skill. Please invoke your skill and try again with a different utterance or update your interaction model to include this utterance before testing again.
After a few tries, I tried to deploy my changes, and see if I can test properly in the console.
It didn't work, although it seems the deployment was successful. I tried to change my profile in "ask init", I tried to remove and reinstall ask-CLI, but this also didn't work.
I tried to clone a skill I had created in the console, and it worked, but when I tried to make changes and deploy, the error came back.
I tried to use "ask simulate" with --force-new-session, but it still didn't work.
I ran "ask dialog" and "ask simulate" with --debug,
This is the output-
{
"id": "fb2869d0-a324-42f6-bca9-4adc0af3476f",
"status": "FAILED",
"result": {
"alexaExecutionInfo": {
"consideredIntents": [
{
"name": "<IntentForDifferentSkill>"
}
]
},
"error": {
"message": "This utterance did not resolve to any intent in your skill. Please invoke your skill and try again with a different utterance or update your interaction model to include this utterance before testing again."
}
And when I inserted it to lambda test, the output was-
{
"errorType": "TypeError",
"errorMessage": "handlerInput.t is not a function",
"trace": [
"TypeError: handlerInput.t is not a function",
" at Object.handle (/var/task/index.js:133:42)",
" at GenericRequestDispatcher.<anonymous> (/var/task/node_modules/ask-sdk-runtime/dist/dispatcher/GenericRequestDispatcher.js:210:59)",
" at step (/var/task/node_modules/ask-sdk-runtime/dist/dispatcher/GenericRequestDispatcher.js:44:23)",
" at Object.next (/var/task/node_modules/ask-sdk-runtime/dist/dispatcher/GenericRequestDispatcher.js:25:53)",
" at fulfilled (/var/task/node_modules/ask-sdk-runtime/dist/dispatcher/GenericRequestDispatcher.js:16:58)"
]
}
The lines in the code-
const ErrorHandler = {
canHandle() {
return true;
},
handle(handlerInput, error) {
const speakOutput =handlerInput.t('ERROR_MSG');//line 133:error
console.log(`~~~~ Error handled: ${JSON.stringify(error)}`);
return handlerInput.responseBuilder
.speak(speakOutput)
.reprompt(speakOutput)
.getResponse();
}
};
I don't know why handlerInput.t suddenly doesn't work, however the problem is in errorIntentHandler, so besids this error, we have the original error.
I tried to debug using my own Node.js endpoint (which, unsurprisingly, didn't work), and it seems that there is a problem with the the endpoint connection.
When it worked before, I usually received a request JSON into my commend line, but now the connection fails before that.
Note:
I tried to open a lot of new projects, so I could check this out.
It didn't worked even after creating new project with ask init and immediately ask deploy.
I'm using jsreport to render HTML and generate a PDF file and it works locally, but on Lambda, it throws this error:
{
"errorMessage": "Error during rendering report: Cannot read property 'filter' of undefined",
"errorType": "TypeError",
"stackTrace": [
"Phantom.execute (/var/task/node_modules/jsreport-phantom-pdf/lib/phantom.js:169:53)",
"/var/task/node_modules/jsreport-core/lib/render/render.js:118:23",
"tryCatcher (/var/task/node_modules/bluebird/js/release/util.js:16:23)",
"Promise._settlePromiseFromHandler (/var/task/node_modules/bluebird/js/release/promise.js:512:31)",
"Promise._settlePromise (/var/task/node_modules/bluebird/js/release/promise.js:569:18)",
"Promise._settlePromise0 (/var/task/node_modules/bluebird/js/release/promise.js:614:10)",
"Promise._settlePromises (/var/task/node_modules/bluebird/js/release/promise.js:693:18)",
"Async._drainQueue (/var/task/node_modules/bluebird/js/release/async.js:133:16)",
"Async._drainQueues (/var/task/node_modules/bluebird/js/release/async.js:143:10)",
"Immediate.Async.drainQueues (/var/task/node_modules/bluebird/js/release/async.js:17:14)",
"runCallback (timers.js:672:20)",
"tryOnImmediate (timers.js:645:5)",
"processImmediate [as _immediateCallback] (timers.js:617:5)"
]
}
Same environment variables, same Node version.
Here's the line that generates the error above: https://github.com/jsreport/jsreport-phantom-pdf/blob/ad8d42e640348abffe77f2fed818528bee3eed98/lib/phantom.js#L169
var phantom = this.definition.options.phantoms.filter(function (p) {
return p.version === request.template.phantom.phantomjsVersion
})
which implies the object path options.phantoms is undefined.
You'll have to check how definitions is set up in your Lambda.
As it turned out, it was a problem of this library: node-app-root-path.
I fixed it by passing the correct rootDirectory option to jsreport.
I'm trying to generate a report on nightwatch cucumber using nightwatch-html-reporter but I'm not able to make it work.
The library I am using is [Nightwatch html Reporter][1], I followed the steps described but I'm getting the error when reading the reports directory:
Reading reports directory...
events.js:160
throw er; // Unhandled 'error' event
^
TypeError: Cannot read property 'name' of undefined
The correct configuration would be:
Create file in root tests, same level of package.json.
var reporter = require('cucumber-html-reporter');
var options = {
theme: 'bootstrap',
jsonFile: 'reports/cucumber.json',
output: 'reports/index.html',
reportSuiteAsScenarios: true,
launchReport: false
};
reporter.generate(options);
And configure runner in package.json. Example:
"scripts": {
"e2e": "npm-run-all test report --continue-on-error",
"test": "nightwatch",
"report": "node create-html-report.js"
}
Make sure it is set up this way, or enter more details of the error.