Semantic-Org / Semantic-UI-Meteor

Official Semantic UI Integration for Meteor
MIT License
224 stars 33 forks source link

Not compatible with Meteor 1.7 #137

Open mishantidev opened 6 years ago

mishantidev commented 6 years ago

Getting this error on Meteor 1.7.0.3. Downgrading to Meteor 1.6.1.3 solves the problem.

Template.languageSelector.onRendered(function() {
    this.$('.ui.dropdown').dropdown({on: 'hover'})
})

TypeError: this.$(...).dropdown is not a function at Blaze.TemplateInstance. (forms.js:12) at blaze.js?hash=a1ff2d6d5ecd59ee11e2ba260b8650a9d1140f59:3398 at Function.Template._withTemplateInstanceFunc (blaze.js?hash=a1ff2d6d5ecd59ee11e2ba260b8650a9d1140f59:3744) at fireCallbacks (blaze.js?hash=a1ff2d6d5ecd59ee11e2ba260b8650a9d1140f59:3394) at Blaze.View. (blaze.js?hash=a1ff2d6d5ecd59ee11e2ba260b8650a9d1140f59:3487) at blaze.js?hash=a1ff2d6d5ecd59ee11e2ba260b8650a9d1140f59:1845 at Object.Blaze._withCurrentView (blaze.js?hash=a1ff2d6d5ecd59ee11e2ba260b8650a9d1140f59:2271) at blaze.js?hash=a1ff2d6d5ecd59ee11e2ba260b8650a9d1140f59:1844 at Object.Tracker._runFlush (tracker.js:511) at onGlobalMessage (meteor.js?hash=c8108d734cc548d91539b054e14b613d0c4512cc:466)

tvogt commented 6 years ago

confirmed for radio checkboxes as well:

Template.CreateForm.onRendered(()=>{ this.$('.ui.radio.checkbox').checkbox(); });

Exception from Tracker afterFlush function: meteor.js:1010:11 TypeError: this.$(...).checkbox is not a function meteor.js:1010:11

rdsimp commented 6 years ago

I fixed this by including the following for dropdown:

import '../../client/lib/semantic-ui/definitions/modules/dropdown'; import '../../client/lib/semantic-ui/definitions/modules/transition';

vbelolapotkov commented 6 years ago

@anjunatic are you still using eager file loading outside of imports folder or switched to package.json entry point options?

mishantidev commented 6 years ago

@vbelolapotkov I use ES6 modules & imports folder for my own files, but semantic UI is located in client folder

vbelolapotkov commented 6 years ago

@anjunatic if you start a meteor 1.7 project from scratch it will create meteor section in you package.json which disables default loading order from your client folder => you have to import your client folder manually. If you want to stick with the old loading behavior just remove meteor section from your package.json and it will load semantic ui.

Anyways, as this package is falling behind the original npm package updates I switched from atmosphere package to npm in the following way:

  1. build js, css, assets from npm package with gulp (in a separate directory)
  2. add compiled files via local package