Giter Site home page Giter Site logo

Comments (10)

damonmaria avatar damonmaria commented on August 16, 2024 1

@alvelig When I run it locally I use: meteor --settings blank-settings.json run android-device

Where blank-settings.json is:

{
  "public": {
    "workaround": "meteor-hmr bug in cordova"
  }
}

So there is no longer the missing public key of Meteor.settings.

To build my APK I also use the same workaround: meteor build ../deploy/build --server ${MOBILE_SERVER_HOSTNAME} --mobile-settings blank-settings.json. But I'm not sure this is needed since when run in production mode meteor-hmr gets out of the way.

from meteor-hmr.

gadicc avatar gadicc commented on August 16, 2024

Hey, thanks for the detailed report!

I've never tested in Cordova, I'll be interested to know how it works. Sounds like it should be ok if you use a settings.json with:

{
  "public": {
    "HOT_PORT": 3002
  }
}

The port is usually 3002 or 2 ports after your Meteor port (more details in the README). Let me know and I'll add this to the README if it works :)

from meteor-hmr.

damonmaria avatar damonmaria commented on August 16, 2024

Apologies. I'm only getting to try this now. With the HOT_PORT specified as above I don't get any errors, but I also don't get any connected or similar messages from HMR. Here's the log plus what happens after making a change (HCP):

=> Started proxy.

WARNING: You are testing your app on a remote device. For the mobile app to be
         able to connect to the local server, make sure your device is on the
         same network, and that the network configuration allows clients to
         talk to each other (no client isolation).
=> Started your app.

=> App running at: http://localhost:3040/
=> Started app on Android Device.
I20160913-12:17:46.192(9)? 09-13 12:17:43.507 31595 31595 I chromium: [INFO:library_loader_hooks.cc(151)] Chromium logging enabled: level = 0, default verbosity = 0
I20160913-12:17:46.269(9)? 09-13 12:17:44.718 31595 31595 I MeteorWebApp: Serving asset bundle with version: 148dde15b63585e82866e982cd4956305df12331
I20160913-12:17:51.155(9)? 09-13 12:17:50.687 31595 31595 I chromium: [INFO:CONSOLE(1185)] "deviceready has not fired after 5 seconds.", source: http://localhost:12088/cordova.js (1185)
I20160913-12:17:51.156(9)? 09-13 12:17:50.687 31595 31595 I chromium: [INFO:CONSOLE(1178)] "Channel not fired: onDOMContentLoaded", source: http://localhost:12088/cordova.js (1178)
I20160913-12:17:51.337(9)? 09-13 12:17:50.849 31595 31595 I chromium: [INFO:CONSOLE(958)] "Accounts.config was called on the client but not on the server; some configuration options may not take effect.", source: http://localhost:12088/packages/meteor.js?hash=0b0ea1099ba8153bbbc5fb555a755bdff3cec0c3 (958)
=> Meteor server restartedI20160913-12:20:05.096(9)? 09-13 12:20:04.626 31595 31595 I MeteorWebApp: Serving asset bundle with version: b34df351ac060ba28b0a9feeaee55e9b6a93fb8f
I20160913-12:20:11.111(9)? 09-13 12:20:10.643 31595 31595 I chromium: [INFO:CONSOLE(1185)] "deviceready has not fired after 5 seconds.", source: http://localhost:12088/cordova.js (1185)
I20160913-12:20:11.112(9)? 09-13 12:20:10.645 31595 31595 I chromium: [INFO:CONSOLE(1178)] "Channel not fired: onDOMContentLoaded", source: http://localhost:12088/cordova.js (1178)

from meteor-hmr.

damonmaria avatar damonmaria commented on August 16, 2024

Also, if I don't put the HOT_PORT in myself (just the original settings.json I posted at the top) and output __meteor_runtime_config__ then on the server I get:

I20160913-12:28:04.734(9)?   "PUBLIC_SETTINGS": {
I20160913-12:28:04.734(9)?     "nothing": "to see here",
I20160913-12:28:04.734(9)?     "HOT_PORT": 3042
I20160913-12:28:04.734(9)?   },

So meteor-hmr is getting it in there. But on the client:

I20160913-12:28:54.321(9)? 09-13 12:28:53.833  5317  5317 I chromium:   "PUBLIC_SETTINGS": {
I20160913-12:28:54.321(9)? 09-13 12:28:53.833  5317  5317 I chromium:     "nothing": "to see here"
I20160913-12:28:54.321(9)? 09-13 12:28:53.833  5317  5317 I chromium:   }

So, it appears the HOT_PORT setting is not getting through. Also, "accountsConfigCalled": true must not be getting through either because of the Accounts.config was called on the client but not on the server I'm getting in the logs. So maybe this is actually some other issue getting in the way. I'll file a Meteor issue about the Accounts.config not working and see if that solves it.

from meteor-hmr.

damonmaria avatar damonmaria commented on August 16, 2024

More stangeness. If I meteor reset (which I do often with Cordova) then the first time I run after that I don't get Starting gadicc:hot-build Accelerator.... The second and subsequent times I do. That's why it wasn't starting above. Not sure if you'd like me to open a new issue for that or not?

When it does start I now get a new error.

gadicc_hot.js:97 Uncaught TypeError: Cannot read property '_collection' of undefined

Here's that code:

// If find() was called before we load                                                                       //
var queries = Autoupdate._ClientVersions._collection.queries;                                                // 39
for (var key in queries) {                                                                                   // 40
  queries[key].changed = augmentChanged(queries[key].changed);                                               // 41
}                                                                                                            // 42

from meteor-hmr.

menelike avatar menelike commented on August 16, 2024

gadicc_hot.js:97 Uncaught TypeError: Cannot read property '_collection' of undefined

I can confirm this, happens here as well.

from meteor-hmr.

damonmaria avatar damonmaria commented on August 16, 2024

I'm going to add Uncaught TypeError: Cannot read property '_collection' of undefined as a new issue.

from meteor-hmr.

alvelig avatar alvelig commented on August 16, 2024

Offtopic: @damonmaria can you please explain how you build the cordova app. I'm trying to solve the problem of Cannot read property 'public' of undefined in production with no luck at all...

from meteor-hmr.

alvelig avatar alvelig commented on August 16, 2024

@damonmaria Thank you very much! Yes it's necessary... With meteor build ... --mobile-settings the problem goes away. Not sure if it is related directly to meteor-hmr, or general meteor bundling, thank you anyway!

from meteor-hmr.

damonmaria avatar damonmaria commented on August 16, 2024

Strange. meteor-hmr gets out of the way when running in 'production', so I would have thought the same thing would happen with a meteor build

from meteor-hmr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.