admin管理员组

文章数量:1313387

Getting these error codes on my github pages. I have these as my order of loading scripts:

<script src="../../node_modules/jquery/dist/jquery.js"></script>
<script src="../../js/bootstrap.min.js"></script>
<script src="../../js/index.js"></script>

Here are the error messages:

GET .js 404 ()
index.html:115 GET .js/dist/popper.min.js 404 ()
util.js:56 Uncaught TypeError: Cannot read property 'fn' of undefined
    at util.js:56
    at util.js:10
    at bootstrap.min.js:6
    at bootstrap.min.js:6
(anonymous) @ util.js:56
(anonymous) @ util.js:10
(anonymous) @ bootstrap.min.js:6
(anonymous) @ bootstrap.min.js:6

Heres my page: /

Other than the order of loading, what else could be causing this?

Getting these error codes on my github pages. I have these as my order of loading scripts:

<script src="../../node_modules/jquery/dist/jquery.js"></script>
<script src="../../js/bootstrap.min.js"></script>
<script src="../../js/index.js"></script>

Here are the error messages:

GET https://tmolano.github.io/CareerMod4/node_modules/jquery/dist/jquery.js 404 ()
index.html:115 GET https://tmolano.github.io/CareerMod4/node_modules/popper.js/dist/popper.min.js 404 ()
util.js:56 Uncaught TypeError: Cannot read property 'fn' of undefined
    at util.js:56
    at util.js:10
    at bootstrap.min.js:6
    at bootstrap.min.js:6
(anonymous) @ util.js:56
(anonymous) @ util.js:10
(anonymous) @ bootstrap.min.js:6
(anonymous) @ bootstrap.min.js:6

Heres my page: https://tmolano.github.io/CareerMod4/

Other than the order of loading, what else could be causing this?

Share Improve this question asked Sep 21, 2018 at 21:45 XoaksXoaks 531 gold badge2 silver badges7 bronze badges 5
  • 1 The first line clearly shows the problem: GET https://tmolano.github.io/CareerMod4/node_modules/jquery/dist/jquery.js 404 (). The path does not exist and the jQuery library is not loaded. – Ram Commented Sep 21, 2018 at 21:49
  • @RachelGallen "load jquery scripts at the top of your html , not the bottom". That doesn't change anything. The path to jQuery library does not exist! – Ram Commented Sep 21, 2018 at 21:57
  • @undefined in the website, the scripts are loaded at the end of the page – Rachel Gallen Commented Sep 21, 2018 at 22:05
  • @RachelGallen You can load the scripts at the end of a page. OP just needs to move them into the end of the body tag. – Ram Commented Sep 21, 2018 at 22:11
  • @RachelGallen ah...I forgot to add my node_modules folder. Also thanks for pointing out tag location. – Xoaks Commented Sep 21, 2018 at 22:13
Add a ment  | 

2 Answers 2

Reset to default 6

Possible reasons for this error:

Uncaught TypeError: Cannot read property 'fn' of undefined

  1. invalid reference to the file addresses or missing files (Your case).
  2. Duplicate reference to the Jquery.
  3. Overriding $ sign of Jquery in 3rd party libraries.
  4. Using Jquery functions before inserting Jquery (Not your case).
  5. Using deprecated syntax for load,error,unload on WINDOW element in jquery without on

Update 2023:

I used this code snippet to fix all the problems I had!

As of bootstrap 5 they will require you to use their Proper . And here I use Bundle and it still works well with all functions

for nextjs 13

  <Script type="text/javascript" src="https://ajax.googleapis./ajax/libs/jquery/3.4.0/jquery.min.js" />
  <Script type="text/javascript" src="https://unpkg./@popperjs/core@2" />
  <Script
    type="text/javascript"
    src="https://cdn.jsdelivr/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
    integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
    crossOrigin="anonymous"
  />

本文标签: javascriptCannot read property of 39fn39 of undefinedStack Overflow