Comments (10)
@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.
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.
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.
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.
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.
gadicc_hot.js:97 Uncaught TypeError: Cannot read property '_collection' of undefined
I can confirm this, happens here as well.
from meteor-hmr.
I'm going to add Uncaught TypeError: Cannot read property '_collection' of undefined
as a new issue.
from meteor-hmr.
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.
@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.
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)
- Check for NODE_ENV !== 'development' and not NODE_ENV === 'production' HOT 7
- When in package but not app: "Arguments to path.join must be strings"
- Redbox problem HOT 2
- [Windows] [beta.6] .babelrc path error HOT 6
- [Windows] [beta.4] Random websockets error HOT 1
- Not working with Meteor 1.3.3.1 HOT 4
- [2.0.0-beta.6] Wrong file getting hot-reloaded HOT 1
- [2.0.0-beta.6] Getting into an infinite loop
- Refused to load the script 'http://localhost:3002/hot.js HOT 9
- Uncaught RangeError: Maximum call stack size exceeded
- "No (relevant) hot.accept() in..." (with an incomplete import chain) HOT 10
- Track dynamic require() calls to augment import chain
- Failed to parse SourceMap: http://localhost:3000/packages/f6ecec4bc04452452b12b571877bd3802b84f242.map
- "Uncaught TypeError: Cannot read property '_collection' of undefined" when run in Cordova
- Path must be a string
- reloading-related WebSock problem stops meteor from booting HOT 1
- Doesn't work with Meteor 1.4.1.2 HOT 27
- Conflict: Constraint [email protected] is not satisfied by babel-runtime 1.0.1. HOT 3
- Info for potential maintainers
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meteor-hmr.