super-mean-stack icon indicating copy to clipboard operation
super-mean-stack copied to clipboard

Uncaught ReferenceError: jQuery is not defined

Open cbritton opened this issue 9 years ago • 2 comments

I followed along on the YouTube video and made it up to section 9 (bootstrap setup). I'm getting this error on the webpage:

Uncaught ReferenceError: jQuery is not defined

I replayed it a few times to make sure I didn't miss anything.

I don't pretend to know how webpack works since this is the first time I tried using it, but this helped:

http://stackoverflow.com/questions/28969861/managing-jquery-plugin-dependency-in-webpack

Specifically about adding this:

new webpack.ProvidePlugin({ $: "jquery", jQuery: "jquery" })

to the plugins in the webpack.config.js file.

BTW, I'm using Windows 8.1 and I ended up modifying the NODE_PATH environment variable and started the server and webpack processes separately in 2 cmd terminals.

cbritton avatar Feb 05 '16 02:02 cbritton

There are some issues when i cloned the git.,especially for windows. I have to modify some import reference as it was reporting module not found. Need to modify the package.json with the following and installed "concurrently" package to run both the commands concurrently.(referred this link )

"start": "NODE_PATH=$NODE_PATH:./src node server", to "start": "node server",

"dev": "npm start & webpack-dev-server --progress --colors",
to "dev":"node ./node_modules/concurrently/src/main.js --kill-others "npm run start" "webpack-dev-server --progress --colors"",

for JQuery reference error, the solution by cbritton worked and this also worked. Need to modify the webpack.config.js (refer this link)

test: /bootstrap-sass/assets/javascripts//, to test: /bootstrap-sass(|/)assets(|/)javascripts(|/)/,

arunagiritm avatar Apr 24 '16 18:04 arunagiritm

This helps!Thanks a lot

DearZui avatar Jul 06 '16 11:07 DearZui