Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: Cannot read property 'versions' of undefined at autoupdate_client.js #87

Closed
lgleim opened this issue Oct 15, 2018 · 3 comments

Comments

@lgleim
Copy link

lgleim commented Oct 15, 2018

With Meteor 1.8, when trying to include the bundled meteor-client.js file as usual, loading the page fails with a fatal error:

Uncaught TypeError: Cannot read property 'versions' of undefined
    at autoupdate_client.js (meteor-client.js:40145)

The issue is that the __meteor_runtime_config__.autoupdate property in the bundled client is undefined:
capture

lgleim added a commit to lgleim/meteor that referenced this issue Oct 16, 2018
This fixes an issue (c.f. Urigo/meteor-client-bundler#87) where when the __meteor_runtime_config__ does not contain a proper autoupdate configuration object, the client would fail to load properly.
@lgleim
Copy link
Author

lgleim commented Oct 16, 2018

I submitted a proper bugfix in upstream meteor code: meteor/meteor#10281

For the time being, a workaround is to add corresponding runtime configuration to the meteor-client.config.json, e.g.

{
  "runtime": {
    "DDP_DEFAULT_CONNECTION_URL": "http://localhost:3000",
    "ROOT_URL": "http://localhost:3000",
    "autoupdate": {
      "versions": {}
    }
  },
  "generateNodeModules": true
}

@lgleim lgleim closed this as completed Oct 16, 2018
@KeithGillette
Copy link

KeithGillette commented Oct 16, 2018

Thanks for the forthcoming fix, @lgleim. This happens to us even though we're still using Meteor@1.7.0.4 locally. Is there a way to pin the Meteor release or package versions in meteor-client-bundler? This is not the first time that Meteor releases we haven't even installed have broken our build process, sorely tempting me to remove Meteor from our client altogether.

@lgleim
Copy link
Author

lgleim commented Oct 16, 2018

Hi @KeithGillette, I am in no way familiar with the inner workings of the meteor bundling/build process but from the meteor-client-bundler documentation I suppose that is what the release config option might be there for (c.f. Readme). The best way to find out though would probably be looking at the code of this project though

benjamn pushed a commit to meteor/meteor that referenced this issue Nov 3, 2018
This fixes an issue (c.f. Urigo/meteor-client-bundler#87) where when the __meteor_runtime_config__ does not contain a proper autoupdate configuration object, the client would fail to load properly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants