meteor/meteor

[Meteor 3] WebApp.addRuntimeConfigHook is broken

Closed this issue · 1 comments

The WebApp.addRuntimeConfigHook function seems to be broken in Meteor 3.0-rc.0. I've put together a very simple reproducer app at https://github.com/ebroder/meteor-runtime-config-test. (The hook itself is here)

If you open the app, the rendered HTML includes the following:

  <script type="text/javascript">__meteor_runtime_config__ = JSON.parse(decodeURIComponent([object Promise]))</script>

and, of course, that cascades into a bunch of errors:

Uncaught SyntaxError: Unexpected identifier 'Promise' (at (index):24:100)
Uncaught ReferenceError: __meteor_runtime_config__ is not defined
Uncaught TypeError: Cannot read properties of undefined (reading 'Meteor')
Uncaught ReferenceError: meteorInstall is not defined

It seems like something isn't being awaited that should be, but I'm pretty sure it's happening outside of my hook. (If I add logging to the hook, it seems like I get valid configuration passed in)

Oh I just realized this is a duplicate of the bug my colleague opened, #12939. Would be great to see it fixed before 3.0 final!