Urigo / meteor-client-bundler

https://blog.meteor.com/leverage-the-power-of-meteor-with-any-client-side-framework-bfb909141008
MIT License
192 stars 41 forks source link

Uncaught TypeError: Cannot convert undefined or null to object #41

Open lingboz opened 7 years ago

lingboz commented 7 years ago

Hi guys I ran into an error that only happens on devices and simulators (my code works well in browser).

To recreate the error, just create a new blank ionic 2 project, and then follow angular-meteor tutorial chapter 1 using Ionic CLI to add necessary webpack supports, etc., then add meteor client blunder plugin and do a meteor-client:bundle in your project folder.

When I run my program in Android simulator, the error is as the picture (you can see this in Chrome inspect window) and nothing is loaded in Android simulator. The same things happens with ios.

image

Does anyone else have this issue?

lingboz commented 7 years ago

BTW, I used Meteor 1.5.1 and Ionic 3.7.0

fernandoarevalo commented 7 years ago

Hi @lingboz

I have the same problem, so I created an issue in the Ionic2CLI-Meteor-WhatsApp git repo. I think that this error isn't the meteor-client-bundler, because testing in devices with different os versions, only it works fine on higher versions to android 5.0, but not in IOS and android 4.4.4.

My issue: https://github.com/Urigo/Ionic2CLI-Meteor-WhatsApp/issues/121

sxxymzy commented 7 years ago

Hi guys, I've got it working by removing the following two dependencies in meteor-client.js. ... _require('core-js/modules/es6.typed.uint8-array'); // line 17020 _require('core-js/modules/es6.typed.uint32-array'); // line 17021 ... I didn't do much tests to ensure its safety, but I think it might be safe if you don't use TypeArray in code. Hope there will be updates soon.

habibadeku1 commented 7 years ago

@sxxymzy , tried out commenting out those lines of code you stated in meteor-client.js. It still returned the same error on mobile chrome etc. Can you please elaborate on how exactly you went about it. Thanks.

sxxymzy commented 7 years ago

@hwonda As the error stacks implied, the error is about the uint8-array dependency. So I just go through those call stacks and remove the dependences. Maybe your error is not exactly same as the pictures? Or there might be other issues after you commented those two lines?

fernandoarevalo commented 7 years ago

Hi guys, @sxxymzy Thank you for the help, I removed the two lines and work fine. :clap::clap::clap::ok_hand:

mvandenbrink commented 7 years ago

Only had this problem with Safari and iOS. Don't have this problem in Chrome on Macbook and Android. I'm using meteor 1.5.1 and ionic 3.6.0. Removed the 2 lines ( lines 22584 and 22585) and the app is working again in Safari and iOS. :thumbsup: for @sxxymzy

mvandenbrink commented 7 years ago

Looked into meteor and found out that these lines were added in 1.5.1-beta.0 and 1.6-beta.24 https://github.com/meteor/meteor/commit/3af430272eb29c4ad3292cfafdb60ca5927a427e

pkitatta commented 7 years ago

@lingboz @fernandoarevalo @blackjack0v0 @sxxymzy is any of you using windows? Because I have deleted those two lines (including in the .meteor packages)everywhere on my computer and yet I still get the error.

lingboz commented 7 years ago

Hi pkitatta

I am using Windows 10. What have you found?

On Tue, Sep 5, 2017 at 11:54 PM, pkitatta notifications@github.com wrote:

@lingboz https://github.com/lingboz @fernandoarevalo https://github.com/fernandoarevalo @blackjack0v0 https://github.com/blackjack0v0 @sxxymzy https://github.com/sxxymzy is any of you using windows?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Urigo/meteor-client-bundler/issues/41#issuecomment-327360035, or mute the thread https://github.com/notifications/unsubscribe-auth/AIIgrYLCobyh91PR-BtKNdbNkrJR42CRks5sfgl9gaJpZM4O2rWa .

-- Regards, Alex. Lingbo. Zou, Dept.of Computer Science, Dalhousie University.

pkitatta commented 7 years ago

I am also using windows 10 and its failed to work on mine after removing the lines. Isn't also odd that those two lines are present in the old script that works without a problem?!

I have tried to find @DAB0mB but have failed to get him.

lingboz commented 7 years ago

Hi guys, there is a new release from Meteor. Meteor has 1.5.2 ready. They claimed they fixed some issues about Node.js V8, and supported Cordova 7.0. What version of Cordova are you using?

https://blog.meteor.com/announcing-meteor-1-5-2-105b53e0debc Have you guys tried anything about the new release?

darkbasic commented 7 years ago

See https://github.com/Urigo/Ionic2CLI-Meteor-WhatsApp/issues/121#issuecomment-328520916

darkbasic commented 6 years ago

A workaround is available: https://github.com/Urigo/Ionic2CLI-Meteor-WhatsApp/issues/124#issuecomment-340248953