Meteor 0.6.0 and Collection API - meteor

Upgraded to the latest 0.6.0 of meteor and Collection API is not define, meteor does not start correctly any more:
ReferenceError: CollectionAPI is not defined
I copy pasted collectionapi to app "packages" folder, but still does not run. Is there anything else I have to do, to use Collection API with latest meteor 0.6.0?
meteor add collectionapi - says: collectionapi: already using
Thanks in advance for any kind of information and help!

I'm not sure copying and pasting packages is a good idea. Have you tried reinstalling it with meteor remove collectionapi and then adding it again?
Update: I seem to be getting the same problem with one of my packages, chartjs. It's now giving a similar error to yours, saying ReferenceError: Chart is not defined. Previously Chart was scoped to the window, so it could be accessed in my client JS files. It must be due to the scoping changes in 0.6.0, but I'm not sure yet how to resolve it - probably the package itself needs updating.
Update 2: Yup, akshat was dead right, the JS file at the heart of the chartjs package needed the var Chart changing to just Chart so it would be scoped to the window object. Have sent a pull request to the package.

Yes, thanks for answers. Fix is also available for download in CollectionAPI github:
https://github.com/crazytoad/meteor-collectionapi/pull/12

Related

Is there a way to get Formik to work in Internet Explorer 11 using NextJS

I've been creating a small website using NextJS. I used formik and google-map-react to validate a form and show a basic map.
IE11 is "not cooperating" in using these libraries. I've tried changing the babel config and used the next-transpile-modules package to try and provide polyfills and transpiling of the node_modules packages without result.
Any push in the right direction will be greatly appreciated!
Kind regards
After further trial and error, I found the package google-map-react to be the problem. Removing the component that uses this package solved the formik/yup errors.
With regards to google-map-react, I removed this package and used the native google maps api package (#googlemaps/js-api-loader => see documentation for usage).
To get nextjs to transpile both packages from the node_modules, the next-transpile-modules package was added and used within next.config.js.
In the end all I had to do was edit my babel.config.json file, the next.config.js and package.json file.
Below are images of what they look like now.
babel.config.json
next.config.js
add this line to package.json
Keep in mind that #babel/core, #babel/preset-env, core-js need to be installed.
I hope this solution is helpful to anybody experiencing the same problems. I also changed the title since formik wasn't the problem.

Changes made to Rocket.Chat are not included after building

I'm new to developing with Meteor and node-based apps.
I intend to create a PR for a problem i noticed in Rocket.Chat.
I git cloned the Rocket.Chat dev branch and made a change to a certain file:
https://github.com/RocketChat/Rocket.Chat/blob/develop/packages/rocketchat-oembed/client/oembedImageWidget.html
After that i ran the build-script successfully. My build started, but the change is not included.
Using the Chrome Dev Tools to inspect the change, i still see the original unchanged code.
I know it's a rather generic question and i'm sure the solution is kind of stupid, but any idea why ?
Thank you.
Kind regards
It looks like the file you modified is in the packages directory. This is dealt with differently.
Check the .meteor/packages files to see if this package is referenced, if it is, then it will install the package from the atmosphere package management system.
Here the steps required to make your changes work...
1) Edit the .meteor/packages file and change the reference to rocketchat:oembed to be simply oembed
2) Edit the file packages/rocketchat-oembed/package.js and do the same thing, change rocketchat:oembed to be simply oembed
Package.describe({
name: 'oembed',
version: '0.0.1',
summary: 'Message pre-processor that insert oEmbed widget in template',
git: ''
});
I think you can leave the directory names as is.
Meteor will now use your local package instead of going out to get the published version of it
In addition to #Mikkel's answer: I think you don't have to change package name, but just change its version. That should be enough for Meteor to rebuild this package from its source and you won't have any dependency issues.

Ionic push: web client incorrectly installs

Following the guidelines here: http://docs.ionic.io/docs/push-from-scratch I am having trouble with step 2 - installing ionic add ionic-platform-web-client.
My index file within my app adds <script src="lib/ionic-platform-web-client/dist/ionic.io.bundle.min.js"></script> as it should, however the file doesn't exist at this location, even after running 'ionic lib update'.
(For ease of explanation in this section I am using the non minified version of the bundle: ionic.io.bundle.js (the results are the same with both full and minified versions of the files)).
Manually adding ionic.io.bundle.js from https://github.com/driftyco/ionic-platform-web-client/tree/master/dist will give me this error:
"Uncaught TypeError: Cannot call method 'get' of undefined
ionic.io.bundle.js (3429,0)"
from this code:
key: "get",
value: function get(name) {
return this._settings.get(name);
}
I found a 'hacky' way to get the dev pushes working by simply returning this instead of the full return this._settings.get(name) statement, although this only really suits the purpose of debugging and additionally does not allow removal of developer mode by settings 'ionic config set dev_push false' or manually setting "dev_push":false in .io-config.json.
I am unsure as to whether manually adding ionic.io.bundle.js is simply adding to my problems or whether this is the right approach to take and that the errors produced are the real problem?
I am running:
ionic 1.1.0
ionic CLI 1.7.7,
cordova 5.3.3,
bower 1.6.2,
npm 2.11.3,
visual studio 2015 community with cordova/ionic setup,
I've also updated my android platform - for which I am currently building to (deploying to nexus 7).
TheCannot call method 'get' of undefined in ionic.io.bundle.js happens because of missing settings in the bundle.
This could be fixed by running:
ionic config build
Although I still haven't been able to install the ionic web platform via 'ionic add ionic-platform-web-client' in the cli I have managed to get the ionic push notifications working.
Firstly I made sure in my app directory within the cli to use 'ionic lib update'. As the setup of my project was different (thanks to visual studio). You will likely already have these files using a custom setup, but I found it's good to have the directories in place.
Secondly I manually downloaded the web client https://github.com/driftyco/ionic-platform-web-client4 not just the ionic.io.bundle.min.js which seemed to fix my "Uncaught TypeError: Cannot call method 'get' of undefined" problem mentioned previously, after I moved the entirety of this in my lib directory. (Make sure the name of the downloaded folder matches: "ionic-platform-web-client" exactly, and doesn't contain any words like master).
Thirdly, as I couldn't add version 1.3.0 of the push plugin (which continually gave me the beloved 'uh oh' error) I used 1.2.3 instead. I installed this via: 'cordova plugin add https://github.com/phonegap/phonegap-plugin-push.git#1.2.31'. Although I have just noticed 1.4.0 is available which may also work?
This should hopefully fix any issues you have, even if it's not a perfect solution. As a side note: I know it is mentioned somewhere on one of the ionic pages that you need to have a traditional project setup and then move the relevant files but it would be nice to have some description of how to go about this - as you may not know what the relevant files are. For anyone who comes here scratching their heads, If you're using visual studio to create your ionic projects from scratch or any other custom setup, you will likely run into the same issues, as the relevant directories created using 'ionic start myApp' will likely have been omitted.

Meteor Project not supported

I am trying to run a project on meteor but getting this error in the command line-
this project uses Meteor1.0.2.1, which isn't available on Windows. To
work with is app on all supported platforms, use ,meteor update
--release METEOR#1.1.0.2 to pin this app to the newest Windows-compatible release.
I have tried updating to which I am getting the error message
while checking for meteorhacks:kadira-binary-deps#1.2.1:error: No
compatible binary build found for this package. Contact the package
author and ask them to publish it for your platform.
I tried updating this to which i was brought back to the first error message.
Does anyone know how I can run this meteor package? It is sparrow-finance to be specific.
Regards
Chris
The answer is simply remove the kadira package which you can do by editing the packages file in .meteor.
But, kadira is really useful. So what I'd suggest is to set up meteor environments. Meteor cookbook has a good example of this - https://github.com/awatson1978/meteor-cookbook/blob/master/cookbook/environment-detection.md .
If your environment is anything other than local, use kadira, else don't use it.

How do you use the mrt:natural package in an app?

I have installed http://atmospherejs.com/mrt/natural by 'meteor add mrt:natural' (I am using Meteor 0.9.1). It seems to be installed ok, but the 'usage' says to simply call :
natural = Natural
This doesn't work when applied on the server or client side. I'm sure this must be so obvious as I can't see anyone else having the problem...
Yes, I am pretty new to Meteor.
This package doesn't seem to be maintained (last update 6 Jun 2013). There's also no need for it to be, since it's a simple wrapper for a Npm package, which can be now loaded in a better way.
Add npm package to your app with
meteor add meteorhacks:npm
and then create packages.json file with natural specified as per documentation. Then you'll be able to require natural with Meteor.npmRequire('natural');.

Resources