You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which is a syntax error. Later, other parts of the meteor runtime expect that variable to be defined, and those error out too.
I'm not particularly familiar with the expected/intended behavior of bindEnvironment in the fiberless world, but if that's behaving as designed, then we probably want something like the following patch in packages/webapp/webapp_server.js to actually await each hook's completion:
We have included a fix on the next PR, which will be included on the upcoming RC. A proper test scenario has been added to cover this untested behavior.
Affected versions: 3.0-rc.0 and 3.0-beta.0 are impacted (and presumably the other 3.0 alphas are all impacted too). Meteor 2.14 is not.
OS: all (verified on macOS 14.2.1 and Fedora Linux 39)
Reproduction repository: https://github.com/zarvox/meteor-trivial-runtime-config-hook
Steps to reproduce:
WebApp.addRuntimeConfigHook()
in server code. The hook can be an empty function; it doesn't matter what it is.meteor
)I believe what's happening is that
packages/webapp/webapp_server.js
calls runtimeConfig.hooks.forEach, andHook
defaults to binding the Meteor environment, which results in wrapping whatever callback the user provided in Meteor.bindEnvironment which seems to return a Promise under meteor 3. Then, when rendered as a string, we get[object Promise]
rather than the intended result of running thehook
function, which gets propagated into the linewhich is a syntax error. Later, other parts of the meteor runtime expect that variable to be defined, and those error out too.
I'm not particularly familiar with the expected/intended behavior of
bindEnvironment
in the fiberless world, but if that's behaving as designed, then we probably want something like the following patch inpackages/webapp/webapp_server.js
to actually await each hook's completion:The text was updated successfully, but these errors were encountered: