meteorhacks / meteor-inject-initial

Allow injection of arbitrary data to initial Meteor HTML page
Other
78 stars 11 forks source link

Breaks with 1.3-modules-beta.8 #17

Closed dferber90 closed 8 years ago

dferber90 commented 8 years ago

The package doesn't work with METEOR@1.3-modules-beta.8. It still works at METEOR@1.3-modules-beta.6, but broke with METEOR@1.3-modules-beta.7.

When using beta-8, the server doesn't inject any data into the initial page.

Reproduction steps:

# clone the default application
$ meteor create foo
$ cd foo
# add meteorhacks:inject-initial package
$ echo "meteorhacks:inject-initial" >> .meteor/packages

Add one file to the top-level directory:

if (Meteor.isClient) {
  console.log('data', Injected.obj('myData'))
}
if (Meteor.isServer) {
  Inject.obj('myData', { hello: 'world' })
}

Now, run the app with $ meteor and everything will work correctly. If you open the browser console, you'll see the log as expected.

This breaks after upgrading to beta-8:

# set meteor to beta-8
$ echo "METEOR@1.3-modules-beta.8" > .meteor/release

Now run the app again with meteor, and open the browser. The console will have a log where data is undefined. The tag for myData will be missing from the page.


I already tried debugging it a bit and it seemed like this monkey-patched function doesn't run nearly as often in beta-8 as in beta-6. The if-block in it never runs, because no chunk matches the regex (actually, all chunks are buffers in beta-8).

gadicc commented 8 years ago

Hey @dferber90, sorry, you wrote this while I was away on a trip and it slipped straight passed me. Thanks for the detailed report; wish I saw it before the other issue :) Anyway, please see this comment and let's continue this there (in short, please confirm if v1.0.4-rc.0 solves the issue for you).

dferber90 commented 8 years ago

Works as expected. Thanks! :-)

silkroadnomad commented 8 years ago

this also solves https://github.com/meteor-utilities/avatar/issues/58 Thanks!