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

[1.3.3-rc.0] BlazeComponents fail to load. #7184

Closed
JesperWe opened this issue Jun 7, 2016 · 10 comments

Comments

@JesperWe
Copy link
Contributor

commented Jun 7, 2016

Since 1.3.3-rc.0 and also in 1.3.3-rc.1, BlazeComponents fail with:

Uncaught ReferenceError: meteorBabelHelpers is not defined
    extend @ peerlibrary_blaze-components.js?hash=d9f1367…:1139
    (anonymous function) @ peerlibrary_blaze-components.js?hash=d9f1367…:1681
    (anonymous function) @ peerlibrary_blaze-components.js?hash=d9f1367…:2367
    (anonymous function) @ peerlibrary_blaze-components.js?hash=d9f1367…:2426
    (anonymous function) @ client.coffee:103

This does not happen in 1.3.3-beta.2 and earlier.

@benjamn

This comment has been minimized.

Copy link
Member

commented Jun 7, 2016

I believe this can be fixed by adding "babel-runtime" here, so that meteorBabelHelpers (defined here and api.exported here) will be available. Can you try that, @mitar?

In the midst of recent changes to meteor-babel, it's likely that we stopped accidentally defining meteorBabelHelpers globally, but I view that as a "good thing" from the perspective of code hygiene :)

@mitar

This comment has been minimized.

Copy link
Collaborator

commented Jun 7, 2016

I agree this is good code hygiene, but I am unsure why a package which does not use ES2016 at all would need dependency on bable-runtime? To me this seems some leaky dependency somewhere else?

@mitar

This comment has been minimized.

Copy link
Collaborator

commented Jun 7, 2016

Also, the link you provided is for tests. I think OP is talking about using package in their own app, not tests?

@benjamn

This comment has been minimized.

Copy link
Member

commented Jun 7, 2016

I think I know what this is… CoffeeScript now calls BabelCompiler.prototype.processOneFileForTarget when a .coffee file contains raw JavaScript (enclosed by backticks). This behavior was introduced in rc.0 (see the 1.3.3 commit log and #6691).

The meteorBabelHelpers namespace is used for only one thing: meteorBabelHelpers.sanitizeForInLoop, which is used to sanitize objects looped over by for-in loops so that those loops behave the same way in all browsers.

So I'm guessing you've got a .coffee file with a for-in loop enclosed by backticks.

Given this analysis, although you could still solve this by depending on babel-runtime, the coffeescript package should really api.imply the same runtime environment that ecmascript provides.

benjamn added a commit that referenced this issue Jun 7, 2016
@mitar

This comment has been minimized.

Copy link
Collaborator

commented Jun 7, 2016

So I'm guessing you've got a .coffee file with a for-in loop enclosed by backticks.

I do not think I use any such strange contraption. :-)

OK, so this is a bug in the coffeescript package. :-)

@ramirez530

This comment has been minimized.

Copy link

commented Jun 7, 2016

Fix big get the right metricks
On Jun 7, 2016 10:17 AM, "Mitar" notifications@github.com wrote:

So I'm guessing you've got a .coffee file with a for-in loop enclosed by
backticks.

I do not think I use any such strange contraption. :-)

OK, so this is a bug in the coffeescript package. :-)


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#7184 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AQaChTnM3CpuEhW2_Lms1AwcKnh1zrAlks5qJaeegaJpZM4Iv9lb
.

@benjamn benjamn referenced this issue Jun 7, 2016
@benjamn

This comment has been minimized.

Copy link
Member

commented Jun 7, 2016

Please retest this issue after doing meteor update --release 1.3.3-rc.4: #7033 (comment)

@JesperWe

This comment has been minimized.

Copy link
Contributor Author

commented Jun 7, 2016

Yes indeed, fixed it is.
Good work!

@JesperWe JesperWe closed this Jun 7, 2016

@benjamn benjamn added this to the Release 1.3.3 milestone Jun 7, 2016

@benjamn benjamn self-assigned this Jun 7, 2016

@jgraham-amplify

This comment has been minimized.

Copy link

commented Sep 12, 2017

There seems to be a similar issue with meteorBabelHelpers being undefined in the context in which Mongo Collection.mapReduce functions run. I'm encountering the same error due to for-in loops being present in my mapReduce code.

I'm not familiar enough with Meteor's packaging structure (or your intentions with Collection support like this) to know what the right solution is, but passing meteorBabelHelpers explicitly in the mapReduce scope fixes the issue, though that is perhaps not ideal. For example:

import { meteorBabelHelpers } from 'meteor/babel-runtime'

options =
    scope:
        meteorBabelHelpers: meteorBabelHelpers
MyCollection.rawCollection().mapReduce(map, reduce, options)

In case it matters, I am also using CoffeeScript — as you can probably tell :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.