[Solved] Fastclick package breaks app

My Meteor 1.2.1 app stopped working in Firefox all of the sudden yesterday, if run from my local development system (MacOS, FF 45.0.1). I did not change anything in the source code, but the console now only throws errors (see log below), the problem occured after a re-build and persisted even when I reverted the project to my latest release version.

Based on the logs I was able to track down the problem to the fastclick package. If I remove this package from the app, it will run without any problems. But as soon as I re-add the package, the error log is thrown.

Is anyone else experiencing this? Might this be an incompatibility with the latest FF version? I have to admit that I have no clue at all how to fix the problem. I even tried a meteor reset and re-install Meteor from scratch. This didn’t help.

I am also wondering what the first line of the log means, since I’ve never seen such sourceMappingURL errors before, and this does not show up on Chrome either.

Here’s the log:

http://localhost:3000/packages/kadira_flow-router.js?3bf0822dc2875cf55697c72e8fde8f4d3c0eebd9 is being assigned a //# sourceMappingURL, but already has one kadira_flow-router.js:2726:4
guzz: Running in webbrowser concats_app-main.js:168:5
mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create matb33_collection-hooks.js:263:5
unreachable code after return statement meteortoys_sub.js:170:3813
unreachable code after return statement meteortoys_email.js:236:964
TypeError: Package.fastclick is undefined
 global-imports.js:9:1
ReferenceError: Template is not defined
 template.modal-dialog.js:2:1
ReferenceError: Template is not defined
 template.simple-message.js:2:1
ReferenceError: Template is not defined
 template.avatar.js:2:1
ReferenceError: Template is not defined
 template.image-slider.js:2:1
ReferenceError: Template is not defined
 template.pagination-bar.js:2:1
ReferenceError: Template is not defined
 template.rating-display.js:2:1
ReferenceError: Template is not defined
 template.app-menu.js:2:1
ReferenceError: Template is not defined
 template.footer.js:2:1
ReferenceError: Template is not defined
 template.header-brand.js:2:1
ReferenceError: Template is not defined
 template.header.js:2:1
ReferenceError: Template is not defined
 template.preloader.js:2:1
ReferenceError: Template is not defined
 template.spinner.js:2:1
ReferenceError: Template is not defined
 template.webapp-main.js:2:1
ReferenceError: Template is not defined
 template.error.js:2:1
ReferenceError: Template is not defined
 template.not-authorized.js:2:1
ReferenceError: Template is not defined
 template.not-found.js:2:1
ReferenceError: Template is not defined
 template.body.js:2:1
ReferenceError: Meteor is not defined
 at-config.js:12:5
ReferenceError: FlowRouter is not defined
 not-found.js:21:1
ReferenceError: Meteor is not defined
 startup.js:9:1
ReferenceError: ReactiveVar is not defined
 modal-dialog.js:15:3
ReferenceError: Template is not defined
 image-slider.js:9:1
ReferenceError: Template is not defined
 pagination-bar.js:25:1
ReferenceError: Template is not defined
 rating-display.js:15:1
ReferenceError: Template is not defined
 app-menu.js:11:1
ReferenceError: Template is not defined
 header-brand.js:9:1
ReferenceError: Template is not defined
 preloader.js:14:1
ReferenceError: Template is not defined
 webapp-main.js:9:1
ReferenceError: Template is not defined
 error.js:9:1
ReferenceError: Meteor is not defined
 startup.js:14:1
ReferenceError: Meteor is not defined
 head.scripts.js:10:1
ReferenceError: Meteor is not defined
 helpers.js:13:5
ReferenceError: BlazeLayout is not defined
 layout.js:9:1
ReferenceError: Meteor is not defined
 push.config.web.browser.js:1:1
ReferenceError: Tracker is not defined
 tomwasd_flow-router-autoscroll.js:60:3
TypeError: $ is not a function
 concats_app-main.js:430:5

Even though you did not update anything (I assume you assured this by checking the versions file) Meteor does still run background processes when a new release becomes available.

People notice this by some kind of delay, even when they are not updating their project.

I see you already created an issue (https://github.com/meteor/meteor/issues/6677) which is the right step. The availability of an update should not break an existing app off course.

1 Like

Thanks for your answer. Yes, I’ve checked my versions file, I even reset the app to a previous state (“last known good”) from some days ago. But this did not change anything. Even after a comple re-install of Meteor (including a rm -r of the ~/.meteor folder) the problem is still there. I now also tried to install previous releases of FF (down to 44), but this did not solve the problem either. It seems as if it is not related to FF. The fastclick package is also on its latest “known good” version, so I don’t have any clue what caused this. I can also describe the symptoms. And yes, I’ve filed an issue in the meantime.

Did you try that package in an empty meteor app with that version fixed?

I did this now. The problem is still there. Will post a repository for reproduction, this is quite obviously a Meteor bug.

The reproduction repo is now available on Github:

Update: the problem even persists if you update the repo to 1.3. Doesn’t seem to be related to 1.2.1.

That repo seems just fine unfortunately:

Strange. On my machine, Firefox won’t show anything if fastclick is included. This is reproducible.

I see: Welcome to Meteor!

Updated with a test on 1.3 also, cannot reproduce the issue in any case.

I am not sure why you did with your install but since you have been here before with such questions a full fresh install (yes it’s unique on OSX) might be an option to save you headaches now and in the future.

You mean a fresh install of OS X? That’s not really possible. But I reset Meteor completely and re-installed it. What else could I do besides re-installing OS X? Re-install Node?

I only had the situation that I needed to re-install Meteor once: when I updated an Meteor 1.1 app to Meteor 1.2, which also broke the app completely (and even the Meteor tools were affected somehow, so other apps were broken, too). This time, I did not even update anything to 1.3 manually, not even a single app. How can it be that an app just breaks?! Is Meteor doing some magic minor updates in the background?!

BTW: There seems to be at least one other guy affected by this, though he also reports the problem to occur on Chrome.

I remembered this one where you also had magical issues with configs. I really have no idea but you should at least try to build a virtual machine or another device so you can test whether an issue depends on your system or not.

And to be clear: I am not sure it’s a bug in your system, it just surprises me that you had issues more with this kind of things.

Yep, this was the problem I was facing when upgrading one (!) app to 1.2. Now I did not even do anything, besides doing a rebuild of an 1.2 app. Will try a re-install of Node.js and an npm update plus another Meteor re-install now. Maybe this helps.

Maybe some piece of software is installed globally instead of locally which keeps bugging?

What kind of software are you thinking of? Besides: I did not install any software when the problem suddenly appeared. It came literally out of nowhere, after a rebuild when I was changing some code. And it persisted even after I reverted everything to a previous state.

I now re-installed Node and removed all unwanted npm packages. I even re-installed Meteor again and let it re-download all community packages. But still no luck. The problem persists.

[quote=“waldgeist, post:15, topic:20543, full:true”]
What kind of software are you thinking of? Besides: I did not install any software when the problem suddenly appeared. It came literally out of nowhere, after a rebuild when I was changing some code. And it persisted even after I reverted everything to a previous state.
[/quote]Is was thinking about some piece of software which Meteor uses. They seem to integrate most software though.

It came literally out of nowhere

Well, I am quite sure Meteor does something when a new version is online available. I don’t know the internals of that. So out of nowhere I think is not right. It’s not intended by you but might have triggered it by just running Meteor.

Ah, ok.

This could pretty much be the case. Though it’s quite strange. I now gave up to hunt down the root cause, I guess I’ll have to wait for MDG’s official response on my issue.

yes sorry have no idea how you can find the issue. I know you can run Meteor in debug mode but I suspect it won’t help much in finding because it’s not crashing.

Edit: Final idea: Could you post the client build output (so HTML + JS + CSS) from both? If you get a Javascript error something has to be different. Maybe a diff of the output on the 2 machines will show it?

1 Like

Well, I can see exactly which line fails. It’s in packages/global-imports.js, and it’s the line where fastclick is referenced:

/* Imports for global scope */
check = Package.check.check;
Match = Package.check.Match;
ECMAScript = Package.ecmascript.ECMAScript;
FastClick = Package.fastclick.FastClick;
...

It’s this last line that’s failing because the Package dictionary does not contain an entry for fastclick. I can see this if I inspect the console. This happens although the package’s JS file is being included in the HTML code and also registers itself to the Package dictionary.