Blaze-html-templates error in Meteor 1.5

I get the following ewrror after upgrading my Meteor/React app to 1.5:

Uncaught SyntaxError: Unexpected end of input
blaze.js?hash=f33d3df…:1898

and other errors like this:
Uncaught TypeError: Cannot read property ‘Blaze’ of undefined
at spacebars.js?hash=ebf9381…:22
at spacebars.js?hash=ebf9381…:335

Does anyone know why?

I tried removing blaze-html-templates and adding back but still have the same error.

Thanks in advance!

Please post here your .meteor/packages file.
Quick guess blaze-html-templates is at the very bottom of this file

1 Like

Indeed it was added to the bottom. It used to be right above reactive-var before I removed it and added it back.

Meteor packages used by this project, one per line.

Check this file (and the other files in this directory) into your repository.

‘meteor add’ and ‘meteor remove’ will edit this file for you,

but you can also edit it by hand.

meteor-base@1.1.0 # Packages every Meteor app needs to have
mobile-experience@1.0.4 # Packages for a great mobile UX
mongo@1.1.18 # The database Meteor supports right now

reactive-var@1.0.11 # Reactive variable for tracker
jquery@1.11.10 # Helpful client-side library
tracker@1.1.3 # Meteor’s client-side reactive programming library

standard-minifier-css@1.3.4 # CSS minifier run for production mode

standard-minifier-js@1.2.1 # JS minifier run for production mode

es5-shim@4.6.15 # ECMAScript 5 compatibility for older browsers.
ecmascript@0.8.0 # Enable ECMAScript2015+ syntax in app code
shell-server@0.2.3 # Server-side component of the meteor shell command

react-meteor-data
check@1.2.5

ethereum:web3

twbs:bootstrap

accounts-ui@1.1.9
accounts-password@1.3.6

themeteorchef:bert@2.1.1
session@1.1.7

email@1.2.1
dispatch:twilio
fortawesome:fontawesome
aldeed:simple-schema
http@1.2.12
mrgalaxy:stripe
abernix:standard-minifier-js
dynamic-import@0.1.0
blaze-html-templates

Yes it was added at the bottom

Is placing it back to the top (between mongo and reactive-var) solves issue?

unfortunately this does not solve the issue

do you think that I have to import Blaze separately ?

Such as:

import {Blaze} from ‘meteor/blaze-html-templates’;

For example if you’re registering global Blaze helper, yes:

import { Blaze } from 'meteor/blaze';

But if are not using Blaze directly - no, no need to import.

Weird… Try to move all MDG packages (without : colon) above those with : colon.
Definitely something loads in wrong order.

And this is prod or dev?

I’m using React everywhere and no Blaze templates. I tried to move the order and the app restarts ok but still get the same errors. This is dev.

I have not yet imported Blaze specifically

Oddly, the first error is
Uncaught SyntaxError: Unexpected end of input
blaze.js?hash=f33d3df…:1898

And the code there is:
1897 Blaze.View.prototype.autorun = function (f, _inViewScope, displayName) { // 159
1898 var self = this;

Well, why not simply remove it completely, as you don’t need this package?

I may have been mistaken. I am full React except for the user accounts:

According to the setup instructions, I do need Blaze templating for now…
https://www.meteor.com/tutorials/react/adding-user-accounts

Meteor comes with an accounts system and a drop-in login user interface that lets you add multi-user functionality to your app in minutes.

Currently, this UI component uses Blaze, Meteor’s default UI engine. In the future, there might also be a React-specific component for this.

To enable the accounts system and UI, we need to add the relevant packages. In your app directory, run the following command:
meteor add accounts-ui accounts-password

1 Like

So, I believe it comes down to finding a React way to manage user accounts without the standard packages which still require Blaze.

We should check what is undefined, could you click on links at stacktrace and take a screenshot. This will help to find what is actually undefined.

Might be a bundler cache issue:
Remove:

  • .meteor/local directory. Or simply run meteor reset. Caution: this will drop local MongoDB
  • node_modules directory

Then:

  • Run meteor npm install --save
  • Run meteor update --packages-only

This issue looks related

Thanks. I followed th
Remove:

  • .meteor/local directory
  • node_modules directory
    Then:
  • Run meteor npm install --save
  • Run meteor update --packages-only

but the app has same errors in the console.

#######

After running meteor update --packages-only , I got the following warning …should I worry about it?


meteor update --packages-only

Changes to your project’s package version selections from updating package versions:

babel-compiler upgraded from 6.19.1 to 6.19.2
blaze-html-templates upgraded from 1.1.0 to 1.1.2
caching-html-compiler upgraded from 1.1.0 to 1.1.2
dynamic-import upgraded from 0.1.0 to 0.1.1
email upgraded from 1.2.1 to 1.2.3
fourseven:scss* upgraded from 3.8.1 to 4.5.0
modules upgraded from 0.9.0 to 0.9.1
react-meteor-data upgraded from 0.2.9 to 0.2.11
templating upgraded from 1.3.0 to 1.3.2
templating-compiler upgraded from 1.3.0 to 1.3.2
templating-runtime upgraded from 1.3.0 to 1.3.2
templating-tools upgraded from 1.1.1 to 1.1.2
themeteorchef:bert upgraded from 2.1.1 to 2.1.2

  • These packages have been updated to new versions that are not backwards
    compatible.

Newer versions of the following indirect dependencies are available:

  • mdg:validation-error 0.2.0 (0.5.1 is available)
  • tmeasday:check-npm-versions 0.2.0 (0.3.1 is available)
    These versions may not be compatible with your project.
    To update one or more of these packages to their latest
    compatible versions, pass their names to meteor update,
    or just run meteor update --all-packages.

I’m sorry, but I think it’s time to fill an issue at Blaze repository.
May be someone else have thoughts? Anyone?

I added the following:

Thanks again for trying … I’ve posted an issue over at Blaze