express-stormpath not recognizing environment variables to initialize on Heroku - javascript

i have a simple web server, trying to use the npm-package 'express-stormpath' for basic user registration.
everything works fine locally - but consistently getting this error when i deploy to Heroku:
Error: apiKey.id is required.
2015-10-23T00:23:52.603692+00:00 app[web.1]: at new RequestExecutor (/app/node_modules/express-stormpath/node_modules/stormpath/lib/ds/RequestExecutor.js:26:37)
i have tried every possible way i can find on the internet to configure this:
1) entirely environment vars, as laid out in https://docs.stormpath.com/nodejs/express/latest/configuration.html#environment-variables
2) a small, private config file in ./stormfront as laid out here :
'apiKey.id is required' error thrown when using express-stormpath with node.js
3) i've tried the following method, manually creating the apiKey object:
https://github.com/stormpath/express-stormpath/issues/135
and nothing works on heroku. any tips?

We have a momentary bug in our Node SDK, please modify your configuration variables to use these new names:
STORMPATH_CLIENT_APIKEY_ID
STORMPATH_CLIENT_APIKEY_SECRET
STORMPATH_APPLICATION_HREF
We made a new release that accepts these new paramaters, but unfortunately it broke backwards compatibility with the old ones. We will relase a fix tomorrow, but you can fix the problem now by using the variables names. Our apologies for this problem!

Related

SMART on FHIR client-js: Invalid Character Error on IE11

Note: The issue is also reported on GitHub. Please take a look at Git issue as well for current progress/investigation.
I'm using fhir-client v0.1.15 to develop a SMART on FHIR web application that would run in EHR launch scenario. For example in Epic Hyperspace simulator that uses IE to run the SMART application.
While testing my application locally(localhost) on IE11, I get a JavaScript error from within fhir-client.js.
SCRIPT1014: Invalid character
File: fhir-client.js, Line: 38113, Column: 3
Below are the two lines from code. 38112 & 38113 in order:
var ret = Adapter.get().defer();
var state = JSON.parse(sessionStorage[params.state]);
Any solution or workaround would be much appreciated.
Updated
Upon further investigation we found that sessionStorage is empty when line with JSON.parse executes. However, strange thing is why/how sessionStorage gets empty after redirection from authorization server. This only happens with IE11, everything works fine on Chrome though.
PS. Can someone please add a new tag SMART or SMARTonFHIR?
Though I couldn't find the exact root cause and solution but let me share the findings that helped me resolve this issue somehow.
The issue doesn't exist when I test my SMART application with redirect_uri(in FHIR.oauth2.authorize call) set to a staging server URL instead of localhost.
PS. I’m open to better, and more qualified answers for acceptance.

Parse request.object.get("KEY") always returns undefined

I have a strange problem over here. I have a project built with Parse.com as a backend (using cloudcode to verify some things when a connection to the database is made). Everything works just as it should do.
But here comes the problem. Another developer reported to me that there is something wrong because he is getting 'undefined' every time he tries to call request.object.get('KEY')in CloudCode. This developer uses the exact same codebase as I do.
So I decided to have a look at it. While with my Parse account, every application works fine (even newly created ones), with the Parse account of the other developer, not a single new application we created seems to work with the exact same code. And it is getting even stranger - creating a completely new Parse account and a new application produces the same errors while my personal account and applications continue to work fine.
So what is the problem? We are using CloudCode, and here is sample code (in javascript) of a beforeSave method:
Parse.Cloud.beforeSave('Activity', function(request, response) {
var currentUser = request.user;
var objectUser = request.object.get('fromUser');
if(!currentUser || !objectUser) {
response.error('An Activity should have a valid fromUser.');
} else {
response.success();
}
});
And every time request.object.get('KEY') returns undefined, for every key I previously defined in the iOS code before uploading the PFObject.
Note that with my personal account everything is fine...
I have already seen this thread, however deleting ACL's didn't do the trick. request.object.get() stays undefined while request.useris defined for every tested Parse account except mine.
EDIT 1
I also had a look at the activity object just before it is uploaded, and there all the fields are properly set.
EDIT 2
After removing the cloud code completely, the objects are correctly being uploaded to Parse, with all the fields being the way they were set via the iOS client. So it seems that something is wrong with Parse's cloud code, but as soon as an object passes through cloud code, it looses all its fields.
Finally I was able to solve this. This is definitely a bug in Parse's Javascript SDK. I changed the Javascript SDK version in the global.json back to version "1.4.2" instead of "latest", uploaded this to the cloudcode folder and everything went back to normal.
You can also test other versions, maybe v1.5.0 is working too, but as soon as I found out v1.4.2 worked fine, I didn't try out more recent versions.
EDIT
So, I discovered, that Parse must have changed something in their command line tool. It seems that the global.json file isn't there anymore if you create your CloudCode folder with the most recent version of their command line tool. However, you can manually create it and upload the complete folder to your Parse app.
This is how my CloudCode folder looks like, just for example:
CloudCode folder contains three subfolders
• cloud - containing cloud code files
• config - containing the global.json file
• public - containing the index.html file
The global.json file contains these lines of code:
{
"global": {
"parseVersion": "1.4.2"
},
"applications": {
"YOUR_PARSE_APPS_NAME": {
"applicationId": "YOUR_APP_ID",
"masterKey": "YOUR_APP_MASTER_KEY"
},
"_default": {
"link": "YOUR_PARSE_APPS_NAME"
}
}
}

Meteor: disable hot code push

I'm developing a phonegap app and hot code push is causing a problem for some of my users (after push, app hangs and users have to re-install the new app).
I'd like to disable hot code pushes and found the following snippet but am getting the error, "TypeError: Cannot call method 'onMigrate' of undefined"
Meteor._reload.onMigrate(function() {
return [false];
});
Looks like the _reload object is only available on the client. I moved the snippet of code to a client directory and that solved it.
Leaving this question / answer here for anyone else who might come across it.
You can set the environment variable AUTOUPDATE_VERSION to something static. You need to set this environment variable when you build your app and when you start the server. (Source)

Sencha build error when viewed in browser

I have finally managed to create a production build of my sencha web app using Cmd 3.10.2.342 and touch 2.2.1
All my bespoke files are included and deltas are created as one would expect. However, when I run it in the browser, it stalls at the loading view. Console log says:
TypeError: 'undefined' is not a function (evaluating 'h.call(w,w)')
I have traced the error to Ext.application({... in app.js.
I have tried the following changes, but still get errors:
new Ext.application({...
Ext.Application({...
new Ext.Application({...
How can I rectify this?
When I generate an apk file, I do not have this problem
In my production app.js, I found this
if(!s){a.set(i,w);if(h){h.call(w,w)}a.triggerCreated(i);return}
I don't really know what it does. I have tried deleting it etc, but it just the gives other errors instead
I traced this back to issues/conflicts with itemId and id where sencha was telling me that a component already existed and should be destroyed.
Solved it by removing id and itemId and used cls instead

Sencha Compile issue while deploying web application using ./make_bootstrap.sh; ./make_compile.sh

Hi I am working on a web application that is implemented in Ext-JS. I deployed the application using Sencha Cmd v3.0.0.250 with command ./make_bootstrap.sh; ./make_compile.sh
No issues during the deployment.
The application can be accessed using the test link //mainApplication/app/index_debug.html or //mainApplication/app (accesses all-classes.js) url....
When the app is deployed it compresses all javaScript files into one file which is all-classes.js. The deployment was successful. But when I access the app from the url ://mainApplication/app/... it shows the following error:
Uncaught TypeError: Cannot read property 'dom' of null all-classes.js:1
Ext.define.initContainerall-classes.js:1
Ext.define.renderall-classes.js:1
Ext.define.doAutoRenderall-classes.js:1
Ext.define.showall-classes.js:1
(anonymous function)all-classes.js:1
TableManager::findTables() content.scripts.c.js:11
However if I access the app using ://myApplication/app/index_debug.html, it works fine. This is for testing purpose and it loads all js files individually unlike accessing through all-classes.js
I have browsed through the web for similar error. But haven't found any at this level. If the application is accessible through index_debug.html why would it not be accessible with the same javaScript files but compressed?
The compressed all-classes.js obviously removes all whitespace and hence it is just a one line code when formatting (using Sublime Text's JSFormatter package) becomes thousands of lines. Since it was one line I couldn't find what the browser is complaining about. I formatted the code and ran the application. And found exactly in which line it failed. It was pointing to an anonymous function. Once I remove the function the app started working... So the tip here is to format the compressed code when debugging in firebug or chrome developer tool.

Categories

Resources