screenshot of browser developer tool - network
I have embedded the script in my base.pug file
script(scr='https://cdnjs.cloudflare.com/ajax/libs/axios/0.19.0/axios.min.js')
Upon loading the page and inspecting the browser developer tool > network, I noticed that all the other necessary files like bootstrap and jquery were loaded successfully except for axios.min.js.
After executing the login.js script as shown below, I encountered an 'Axios not defined' error in the console.
Any suggestions or guidance would be greatly appreciated.
I've attempted placing the script at the beginning of the base.pug page, checked for syntax errors, and tried using a different link - but the same error persists.
base.pug file
body
// HEADER
include _header
// CONTENT
block content
// FOOTER
include _footer
// FOOTER
include _footer
script(src='/js/login.js')
script(scr='https://cdnjs.cloudflare.com/ajax/libs/axios/0.19.0/axios.min.js')
script(src='https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js' integrity='sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1' crossorigin='anonymous')
login.js file
doctype html
html(lang='en')
head
block head
meta(charset='UTF-8')
meta(name='viewport' content='width=device-width, initial-scale=1.0')
meta(http-equiv='X-UA-Compatible' content='ie=edge')
link(rel='stylesheet' href='https://use.fontawesome.com/releases/v5.8.1/css/all.css' integrity='sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf' crossorigin='anonymous')
link(rel='stylesheet' href='https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css' integrity='sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T' crossorigin='anonymous')
link(rel='stylesheet' href='/css/style.css')
link(rel='icon' type='image/ico' href='/img/favicon.ico')
title Sales App #{title}
body
// HEADER
include _header
// CONTENT
block content
// FOOTER
include _footer
script(src='/js/login.js')
script(scr='https://cdnjs.cloudflare.com/ajax/libs/axios/0.19.0/axios.min.js')
script(
src='https://code.jquery.com/jquery-3.4.0.min.js'
integrity='sha256-BJeo0qm959uMBGb65z40ejJYGSgR7REI4+CW1fNKwOg='
crossorigin='anonymous')
script(src='https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js' integrity='sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1' crossorigin='anonymous')
ReferenceError: axios is not defined at login (login.js:7) at HTMLFormElement. (login.js:26)