question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

webpack integration

See original GitHub issue

there is a bug in materialize when working with webpack. when I add materialize this way

import 'jquery';
import 'materialize-css';

I get this exception on Horizontal FAB from the button components (http://materializecss.com/buttons.html#floating)

Uncaught TypeError: $this.find(...).velocity is not a function

but when I add the script the normal way

<script src="https://code.jquery.com/jquery-2.2.0.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.5/js/materialize.min.js"></script>

it works, so the problem is when I bundle materialize.js, some functions stop to work. what can I do to fix it?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:8

github_iconTop GitHub Comments

3reactions
yyyuuu777commented, May 15, 2017

oh , i solve this issue by easy way , the problem is cause by jQuery , you can use materialize package jQuery , just like : window.$ = window.jQuery = require('materialize-css/node_modules/jquery/dist/jquery.js')

3reactions
seemsindiecommented, Jan 18, 2016

@MurhafSousli I had the same error but managed to solve it by requiring it in my entry file like:

require('materialize-css/dist/css/materialize.css')
require('materialize-css/dist/js/materialize.js')

I don’t like this but it’s working.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Integrations | webpack
This guide provides a high-level overview of how webpack can be integrated into some of the more popular task runners. NPM Scripts. Often...
Read more >
Using with webpack - Jest
Jest can be used in projects that use webpack to manage assets, ... over other tools because it integrates directly with your application...
Read more >
Integration with Webpack - Flexmonster
Integration with Webpack · Step 1. Create a new project based on the sample from GitHub · Step 2. Install npm packages ·...
Read more >
Webpack Integration - CKEditor 4 Documentation
# Basic Webpack Integration · mkdir ckeditor4-webpack cd ckeditor4-webpack npm init -y · npm install --save-dev ckeditor4 webpack webpack-cli · 'use strict'; const ......
Read more >
@sanity/webpack-integration - npm
Start using @sanity/webpack-integration in your project by running `npm i @sanity/webpack-integration`. There are 4 other projects in the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found