I configured require.js very well and it is working fine but when I added Identity Pages in ASP.NET Core 3.1 require js started to giving 404 error when loading script files, jquery, jquery-validation and jquery.validate.unobtrusive. When I check the console the path is wrong, and it is trying to find these files near require.js file directory (as you know it is default directory) but in my config file I configured path as very well and working in my other pages but not in identity pages.
Here my require.js config file
requirejs.config({
//By default load any module IDs from js/lib
baseUrl: '../',
//except, if the module ID starts with "app",
//load it from the js/app directory. paths
//config is relative to the baseUrl, and
//never includes a ".js" extension since
//the paths config could be for a directory.
paths: {
jquery: 'lib/jquery/dist/jquery.min',
main: 'js/bundle/main.min',
'jquery.validate': 'lib/jquery-validation/dist/jquery.validate.min',
'jquery.validate.unobtrusive': 'lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min'
},
shim: {
'jquery.validate': ['jquery'],
'jquery.validate.unobtrusive': ['jquery', 'jquery.validate']
},
waitSeconds:0
});
It is working my other pages but not in identity when I check the 404 error the console error is;
RequireJs.js:5 GET https://localhost:44340/lib/RequireJs/jquery.js net::ERR_ABORTED 404
Shouldn't it use the requirejs config and shouldn't be the path is
RequireJs.js:5 GET https://localhost:44340/lib/jquery/dist/jquery.min.js like other pages ?
Thanks for any comment, Stay health folk :)