Running meteor project on a newer version - meteor

Five months ago I created a project using meteor windows version 0.5.x, project works great on that version of meteor, but today, when I migrated to version 0.6.4.1 I had problems with the functionality of the project, three functions from model.js loss reference in client.js call (undefined functions).
Exception from Deps recompute: ReferenceError: displayName is not defined
(but, this function is defined in model.js)
I noticed, from browser console that every function of the model lose reference in client.js.
I tried to run the project using the command
meteor --release 0.5.x
but every try to run I get the error "Can't specify a release when running meteor from a checkout".
What would be the problem for undefined reference functions (in the release of newer version).

Meteor 0.6.x changed variable scoping across multiple files : each source file is encapsulated inside an anonymous function making its local var/function declarations visible only to the concerned file.
To enable exporting symbols and reference them in other files, you now have to use this syntax :
myVar=value;
// instead of
var myVar=value;
myFunc=function(){...};
// instead of
function myFunc(){...}
If you did something like
function displayName(){...}
in model.js, try replacing it with
displayName=function(){...};
I'm pretty sure it will do the trick.

Related

Lightweight Rendering Pipeline error

I downloaded the lightweight rendering pipeline using Unity's package manager, but I cannot create a lightweight pipeline asset. When I try to create the asset, the console throws me:
Invalid generated unique path 'ProjectSettings/LightweightAsset.asset'
(input path
'LightweightAsset.asset')UnityEngine.Experimental.Rendering.LightweightPipeline.LightweightPipelineAsset:CreateLightweightPipeline()
I had a similar issue but it went away after I did the following:
Using the new package manager: Remove all rendering-related packages from the Unity project and then only add the Lightweight
Rendering Pipeline package. All dependencies (like the Shader Graph) were
added automatically and correctly after I did that.
Be sure to get the newest preview release (1.1.5-preview or newer). The 0.1-releases are too old.
If all else fails, try to follow the instructions and clone it directly from the Github repository: https://github.com/Unity-Technologies/ScriptableRenderPipeline

Ionic using PounchDB fail

I`m testing PounchDB for my new app and, i receive this error when try execute this code:
PouchDB.plugin(require('pouchdb-adapter-cordova'));
_db = new PouchDB('mydb.db', {adapter: 'cordova-sqlite'});
Erro received:
ReferenceError: Can't find variable: require
I follow instructions from: https://github.com/nolanlawson/pouchdb-adapter-cordova-sqlite
Using ionic 1.
You're using require without an associated package manager or module bundler. require is not native to JavaScript -- you have to include a library or package your app in order for this to work.
I suggest JSPM (http://jspm.io), since it works with SystemJS and supports the newest ES2015 module syntax. However, it also understands require.
Alternatively, you can use Browserify(http://browserify.org) to bundle your code (essentially Browserify packs everything into one file, which is great for production!). Webpack(https://webpack.github.io) is also a great option. Both of these will add a build step to your development workflow, so be aware of that (but you should have one anyway).

How to read Meteor settings from a build plugin

I'm currently working on a package for Meteor that includes a build plugin. I need to access configurations from the settings file.
However Meteor.settings doesn't work (Meteor is not defined) and process.env.METEOR_SETTINGS also doesn't exist.
Is there any way for my plugin to access the settings file?
It appears that despite the documentation discussing the use of --settings, it doesn't work in a production environment, as often command line options are not available.
So the solution is to use environment variables, which are available only on the server.
server code, meteor methods:
eor methods
Meteor.methods({
getPJS: function() {
return process.env.PEERJS_SERVER;
},
client code
var PJS = Meteor.call("getPJS");
So you can make those environment variables available on the client if you need them.

Meteor: jQuery is not defined

I am having a problem with using jQuery in my Meteor app. It is undefined.
When I look inside .meteor/versions, I can clearly see:
jquery#1.11.3_2
But when I type $ or jQuery in my Chrome console, I get undefined. Also, I cannot use external packages that use any jQuery; I get undefined is not a function exception.
Manually adding jQuery package by meteor add jquery did not solve the issue.
Any idea why this happens?
jQuery is inside the meteor core and defined as a dependency inside meteor-platform. So I never declare it as a a dependency. Meteor relies heavily on it, so it's unlikely to ever be removed. Unlike underscore, which they stated they will remove in a future release. Meteor always aliases $. So that should work. It can't be an issue with that specific version. I'm running the same without any issues. Here are some things you could try to debug:
Create a new project and check if JQ works
Check if an installed package is causing the problem (by removing them one by one)
Packages get loaded before your code, so that can't be the problem.

deploying Qt/QML App with LocalStorage (Sqlite) on OS X

I'm doing an app with QML that uses LocalStorage to store some informations.
It's working fine when I run in debug mode.
My storage.js that access the database is like that.
.import QtQuick.LocalStorage 2.0 as Sql
// First, let's create a short helper function to get the database connection
function getDatabase() {
return Sql.LocalStorage.openDatabaseSync("MyApp", "0.1", "StorageDatabase", 100000);
}
My Qt .pro file contains the Sql module:
QT += sql
And at first moment it runs fine in Release mode either.
But when I try to deploy on OSX, running macdeployqt like that:
macdeployqt MyApp.app -dmg -qmldir=../MyApp/qml/
First I got one error, but I think that's ok because I don't use MySQL: ERROR: no file at
"/opt/local/lib/mysql55/lib/libmysqlclient.18.dylib"
I'm using sqlite via LocalStorage.
Then trying to run in Release mode it doesn't work anymore, the database access doesn't work, not even the in the deployment it works... now when I try to run the app I got the error:
storage.js:5: ReferenceError: Sql is not defined
The line 5 is this one:
return Sql.LocalStorage.openDatabaseSync("MyApp", "0.1", "StorageDatabase", 100000);
And the Sql name is defined in the first line:
.import QtQuick.LocalStorage 2.0 as Sql
Looking for this error in the internet I found some places telling to do exactly what I did, like here: https://qt-project.org/forums/viewthread/28371
Any clue about this?
I'm using Qt5.2, Quick 2.0, Qt Creator 3.01
The problem was related to this Qt bug that is here since Qt5.1
https://qt-project.org/forums/viewthread/29805/
I've used the script and custom macdeployqt linked in the post to make this work.
Script: https://gist.github.com/lasconic/5965542
Custom macdeployqt: https://github.com/MaximAlien/macdeployqt
It seems that Qt is not giving much attention to desktop development, only that explains a bug like that not fixed yet.

Resources