Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Getting "Uncaught TypeError: $(...).select2 is not a function" when the give index.html file is used within Electron Framework
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<script src='' type='text/javascript' >
$ = jQuery = module.exports
console.log("$.fn", $.fn)
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<link href="" rel="stylesheet">
<link href="" rel="stylesheet">
<script src="" onload="if($.fn){console.log('select2 loaded:', $.fn);}"></script>
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
<select class="js-example-basic-single" name="state">
<option value="AL">Alabama</option>
<option value="IL">Illinois</option>
<option value="WY">Wyoming</option>
$(document).ready(function() {
console.log('fn.select2: ', $.fn)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment