ColorlibHQ / AdminLTE

AdminLTE - Free admin dashboard template based on Bootstrap 5
https://adminlte.io
MIT License
44.06k stars 18.16k forks source link

Uncaught TypeError: Cannot read property 'options' of undefined #253

Closed kaynewilder closed 9 years ago

kaynewilder commented 9 years ago

My sidebar is broken.The menu doesn't seem to dropdown. I inspected element and found this error:

Uncaught TypeError: Cannot read property 'options' of undefined

I have read similar problems but I can't seem to find the answer to mine.

almasaeed2010 commented 9 years ago

You are going to have to give a little more details to your problem. Where does that problem occur? Which JS file produced this error? Which version of AdminLTE are you using? Any other information that you can place here will help us help you. Thanks.

kaynewilder commented 9 years ago

Hi. I was using this: https://github.com/almasaeed2010/AdminLTE and the problem occurs when I load my index page, the side nav is broken, like the submenus are showing already and also the charts are not visible, it's just blank space. But anyway, I have found an alternate solution. I have used the asset bundle instead and now it is working fine.

theroadrunnershow commented 9 years ago

Hi I am having this same issue. I am using AdminLTE-2.0.3. Any help would be super, as I cannot seem to find the problem. COuld you please help?

This error seems to be occuring in app.js, when we are trying to retrieve the options of adminLTE object. (line 128: var o = $.AdminLTE.options;)

Please note: I am trying to use this with meteorJS.

Error details Uncaught TypeError: Cannot read property 'options' of undefined app.js?6e718cf14bb55f1e3752044b0e79a4027a4b22f6:128 (anonymous function)jquery.js:3143 jQuery.Callbacks.firejquery.js:3255 jQuery.Callbacks.self.fireWithjquery.js:3467 jQuery.extend.readyjquery.js:3498 completed

Seany84 commented 9 years ago

I had this error and found that by moving my script reference from the to right before the closing body tag resolved my issue.

iamvajid commented 9 years ago

I am facing the same issue. But my script tags are before body only. I'm using sailsjs and when i view this file as starter.ejs through any route, this issue comes. But when i open the starter.html simply, this issue is not there. Issue is at app.js 151, says undefined.

pheliperocha commented 9 years ago

I had this too. Some script are interrupting. The script need to be the last one script to run. Move right before the closing body like Seany84 said.

stringsanbu commented 8 years ago

Adding for reference: I had this issue was well. Make sure none of your scripts are duplicated, I accidentally copied the JQuery 2.1.4 script in 2 different spots (made it harder to spot) and this caused the error.

lfaire commented 8 years ago

Make sure to require "jQuery-2.1.4.min" before adminlte app javascript. That's how I solved it.

bchellingworth commented 8 years ago

For anyone using Rails. I had added the jquery gem and also had jquery linked at the bottom of my application layout html. (I copied and pasted my old template :( )

Just make sure if you are using jquery gem you dont need to link jquery again.

removing the jquery link solved my problem.

veerabiz1 commented 8 years ago

use app.js instead of app.min.js and remove the following code

$.AdminLTE = {};

/* --------------------

paste the above code below

$(function () { "use strict";

it works me

deepaksaini143 commented 7 years ago

facing same problem admin_error

Copied and paste your solution but still have same problem

diptidsheth commented 7 years ago

I'm also facing same issue when I use following for print functionality in master page:

 <script src="{{asset ('/public/plugins/datatableprintcsv/jquery.dataTables.min.js') }}"></script>
<script src="{{ url('https://cdn.datatables.net/buttons/1.2.4/js/dataTables.buttons.min.js') }}"></script>

Left menus are not working .

rjankathi commented 7 years ago

Hi , Anybody tried AdminLTE with Angular ? I tried initializing the sidebar push menu as below in one of my components. Everything is bundled in vendor.js in order 1. Jquery, 2. app.js

var o = $.AdminLTE.options;

    //Activate sidebar push menu
    if (o.sidebarPushMenu) {
        $.AdminLTE.pushMenu.activate(o.sidebarToggleSelector);
    }

I get the following error ORIGINAL EXCEPTION: Cannot read property 'options' of undefined. I tried to check if it is even getting the AdminLTE object its undefined as well. How should I make it available to Jquery ($ ) any insight would help. p.s When I click on hamburger it simply goes to home page Update: I loaded them separately and it didnt help

Phil795 commented 7 years ago

I had the same problem like @kaynewilder and the comment from @veerabiz1 solved this problem!

wladneto commented 7 years ago

I resolved! The app.min.js calls jquery automatically... if you call another jqyery you will the same problem.

skyview059 commented 7 years ago

In my code I replace '$' with 'jQuery' and my problem solved

brian-lamb-software-engineer commented 6 years ago

I was having this problem with jQuery, having AdminLTE and Vue.js involved, in a Laravel framework. It was because i had the bootstrap.js loading too low on the chain, i had to move that to the top, before my vendors. .

2root2 commented 6 years ago

Problem is most likely due to sequence of linking app.js, please load it after loading all JS files

bdpadrino commented 5 years ago

I delete in datatable.min.js the JQuery v3.3.1 to work with version that is already there in AdminLTE template

shobhitk8055 commented 4 years ago
  1. Where you are including scripts, use app.js instead of app.min.js
  2. On line 144 remove $(function () { and on line 228 remove });
  3. Done!! conflict