2
votes

I am using Foundation v5.5.3 with a Laravel 5.1 project. I have a modal that was working properly yesterday but has for some reason started throwing an Uncaught TypeError: modal.on(...).trigger is not a function error now whenever I click on the button that is supposed to launch the modal.

I researched as much as I could on the issue, but this problem seems to be unique. I had originally tried wiping my composer.json file and running composer install, then my node_modules folder and reinstalled with sudo npm install. Eventually I deleted the whole project and pulled the master branch from git. Still no luck.

The oddest part is that my coworkers are using the exact same version of Foundation as well as the same Laravel 5.1 project that we're working on and their modals work just fine. I don't understand how I can have exactly the same setup and for mine to be the only that doesn't work. All other Foundation-related JS is working normally.

This is what the HTML looks like:

<section class="row">
    <article class="small-centered medium-6 column text-center">
        <h2>You haven't uploaded any files yet.</h2>
        <p>
            <a href="https://adder.local/support" target="_support">Follow our guide here</a>.
        </p>
        <a href="#" class="button radius small" data-reveal-id="new-upload">New File</a>
    </article>
</section>

<div id="new-upload" class="reveal-modal small" role="dialog" data-reveal>
    <label>Upload Log File</label>
    <input type="file" name="logfile">
</div>

Has anyone ever come across this issue? How did you fix it? If not, what steps would recommend (that I haven't tried) to fix this issue and what would be causing this to happen only on my machine?

1
Is an ad blocker interfering? Just guessing.Clayton Leis
@ClaytonLeis No, I don't have an adblocker installed. The problem is the same on Chrome and Firefox.Graham S.
This just started happening to me as well. Same project: one computer works completely fine, another computer modals don't work (slightly older MBP, same software version). Currently looking for a resolution...micjamking

1 Answers

6
votes

jQuery recently updated (v2.2) which breaks reveal in Foundation v5.5.3.

Rolling back to jQuery v2.1.4 resolves the issue.

$ bower install --save jquery#2.1.4

Ref: https://foundation.zurb.com/forum/posts/37579-reveal-stopped-working