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

Meteor, Bootstrap, and Tether #19005

Closed
mazing opened this issue Jan 22, 2016 · 20 comments
Closed

Meteor, Bootstrap, and Tether #19005

mazing opened this issue Jan 22, 2016 · 20 comments
Labels

Comments

@mazing
Copy link

mazing commented Jan 22, 2016

In Bootstrap v4 alpha 2, I get the error

Uncaught Error: Bootstrap tooltips require Tether (http://github.hubspot.com/tether/)

I have in Meteor tried loading Tether using the package simply:tether, but the error message remains.

Can I opt to not require Tether since I wont use Bootstrap's tooltips.

@cvrebert cvrebert changed the title Bootstrap requires Tether Meteor, Bootstrap, and Tether Jan 22, 2016
@wolfy1339
Copy link
Contributor

wolfy1339 commented Jan 22, 2016

You can just safely ignore that error.
A workaround that was posted was setting window.Tether = {}

@cvrebert
Copy link
Collaborator

CC: @splendido @dandv because this involves Meteor

@cvrebert cvrebert added the meteor label Feb 2, 2016
@birish2
Copy link

birish2 commented Feb 3, 2016

I have the exact same error when hosting the Bootstrap v4 alpha 2 Dashboard example on a Django app. So this error might not be specific to Meteor.

@cvrebert
Copy link
Collaborator

cvrebert commented Feb 3, 2016

@birish2 This issue is Meteor-specific. If you're seeing that error message and aren't using Meteor, then you're either not including Tether properly, or you're not exposing Tether as a global (i.e. window.Tether) which is currently necessary until we resolve #17201.

@splendido
Copy link
Contributor

@mazing I'd say, if you also added simply:tether, it might be a problem with the order packages are loaded: i.e. twbs:bootstrap gets loaded before simply:tether.
As a workaround you could try edit your .meteor/packages file and make sure tether appears before bootstrap.

As a stable solution we might add simple:tether as a weak dependency for twbs:bootstrap so to ensure correct load order for the packages.
Then we should check simple:tether is the best option, well maintained and regularly updated...
...but this won't be a problem when [email protected] will be out since support for npm packages will come and we might refer the official tether package.

@mazing could you try see whether changing the order in your .meteor/packages file solves the problem for now?

@panaali
Copy link

panaali commented Feb 25, 2016

This worked for me:

meteor remove twbs:bootstrap
meteor add coursierprive:tether
meteor add twbs:bootstrap@=4.0.0-alpha2

@orgztion
Copy link

orgztion commented Mar 6, 2016

On Meteor 1.3 is you need Bootstrap 4 from npm do this:

npm install tether --save
npm install [email protected]
meteor add orgztion:meteor-global-tether

https://github.com/orgztion/meteor-global-tether package import Tether from npm and expose it globally.

a working example: https://github.com/bySabi/neal-sample-meteor

@cvrebert
Copy link
Collaborator

cvrebert commented Mar 7, 2016

Asked the Tether folks whether they'd consider publishing a Meteor package: shipshapecode/tether#153
Then we could just add a dependency on the official Tether Meteor package.

@arechsteiner
Copy link
Contributor

What about people who don't want to use tool tips? This error forces everyone to include tether, whether they need it or not. I had the impression tether was opt-in when needed.

@cvrebert
Copy link
Collaborator

@arechsteiner You want #17201.

@cvrebert
Copy link
Collaborator

Closing as no longer applicable per #20389.

@diegonc
Copy link

diegonc commented Nov 23, 2016

@orgztion your repo meteor-global-tether gives a 404. any insight into why's that? have you found another way of providing tether under meteor?

@bySabi
Copy link

bySabi commented Nov 23, 2016

@diegonc this package is offline cause is not needed.
On meteor you can use a workaround like this:
https://github.com/bySabi/neal-sample-meteor/blob/master/packages/workarounds/client.js

@jbockerstette
Copy link

Do the following:

meteor npm install tether --save
cp ./node_modules/tether/dist/js/tether.min.js ./public/
//Add this line to your index.html
<head>
...
    <script type="text/javascript" src="tether.min.js"></script>
...

Anything in the /public folder can be found by the client browser.

@diegonc
Copy link

diegonc commented Dec 7, 2016

Well, I hope not to sound rude, but that's a weird dance there and doesn't look very Meteorish 😄

I'd rather do

import _Tether from 'tether';
window.Tether = _Tether;

in some early loaded client file (just like bySabi's workaround but with an actual implementation).

But I can't say whether it works, I'm still using the package 😁

@jbockerstette
Copy link

jbockerstette commented Dec 7, 2016 via email

@diegonc
Copy link

diegonc commented Dec 7, 2016

@jbockerstette

For me, what set off alarm bells in your solution is that there are two manual steps (cp & script) that one needs to remember each time tether is upgraded to also keep our project in good shape.

From my experience, Meteor tends to discourage script tags in index.html and instead relies on its script concatenation & minification process to build a bundle that gets automatically include in the served HTML.

If you are using bootstrap from NPM, then you can just drop the two lines I mentioned before the import 'bootstrap'; statement in main js file.

If you are using the atmosphere package then you need a custom package which should be listed before bootstrap in .meteor/packages file; look for instance at bySabi's link. But that's arguably more complicated, and if one doesn't intend to update tether "frequently", I'd rather use your solution.
Anyway, considering there's no longer a Bootstrap atmosphere package, the NPM based solution is probably better.

@ everyone
BTW, sorry for hijacking this closed issue

@jbockerstette
Copy link

Thanks Diego. I knew my solution was not optimal but it was the only way I could get it to work. I was able to get bySabi's solution to work in my project. So I am now going to use that. Thank you!

@demiantriebl
Copy link

hi! i use meteor 1.4.4 and i can't install tether , i use npm, and the package but don't work, any clue?

@cvrebert
Copy link
Collaborator

Locking old closed issue that's veering off onto tangents.

@twbs twbs locked and limited conversation to collaborators Apr 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests