1

I'm working on a ASP.NET MVC5 application, I recently switched from VS2013 to VS2012 after doing so, I seem to be getting these errors on every page load for my website.

GET http://localhost:1360/Scripts/dhtmlxScheduler/sources/dhtmlxscheduler.js.map 404 (Not Found) :1360/Scripts/dhtmlxScheduler/sources/dhtmlxscheduler.js.map:1

GET http://localhost:1360/Scripts/dhtmlxScheduler/sources/ext/dhtmlxscheduler_limit.js.map 404 (Not Found) :1360/Scripts/dhtmlxScheduler/sources/ext/dhtmlxscheduler_limit.js.map:1

GET http://localhost:1360/Scripts/dhtmlxScheduler/sources/ext/dhtmlxscheduler_tooltip.js.map 404 (Not Found) :1360/Scripts/dhtmlxScheduler/sources/ext/dhtmlxscheduler_tooltip.js.map:1

GET http://localhost:1360/Scripts/dhtmlxScheduler/sources/ext/dhtmlxscheduler_serialize.js.map 404 (Not Found) :1360/Scripts/dhtmlxScheduler/sources/ext/dhtmlxscheduler_serialize.js.map:1

GET http://localhost:1360/Scripts/dhtmlxScheduler/sources/ext/dhtmlxscheduler_timeline.js.map 404 (Not Found) :1360/Scripts/dhtmlxScheduler/sources/ext/dhtmlxscheduler_timeline.js.map:1

For the file path, Scripts --> dhtmlxScheduler --> "Sources" I do not have a sources folder anywhere in dhtmlxScheduler. nor do I have any files ending in ".js.map"

This is my layout in my view:

<script src="@Url.Content("~/Scripts/dhtmlxScheduler/dhtmlxscheduler.js")" type="text/javascript" ></script>
<script src="@Url.Content("~/Scripts/dhtmlxScheduler/ext/dhtmlxscheduler_limit.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/dhtmlxScheduler/ext/dhtmlxscheduler_timeline.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.tooltipster.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/dhtmlxScheduler/ext/dhtmlxscheduler_serialize.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/dhtmlxScheduler/ext/dhtmlxscheduler_tooltip.js")" type="text/javascript"></script>

RouteConfig:

public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
        }
    }

any help will be greatly appreciated.

1

2 Answers 2

3

You need to use Url.Content() to generate correct absolute url from relative url:

<script src="@Url.Content("~/Scripts/dhtmlxScheduler/dhtmlxscheduler.js")" 
        type="text/javascript">
</script>
Sign up to request clarification or add additional context in comments.

4 Comments

Thanks for the suggestion, though even when applying the solution above, still getting the same error.
consider your routing configuration
Note you may not actually need to explicitly invoke Url.Content razor will interpret href="~/Home" correctly. I can't say for sure it works for src attributes but i'm atleast 80% certain.
but Url.Content() must be used if the project is hosted on server in some inner directories sometimes url is generated wrong and scripts won't load
1

All the 404s are for map files. They're either being requested by your browser's developer tools or something like BrowserLink (which seems like a safe bet since it happened when you moved to 2013). Either way, these files aren't required, and the 404s won't show up in production unless developer tools are similarly employed. I wouldn't worry about it.

1 Comment

Just for clarity, map files are essentially translations for minified scripts. It allows developer tools to show the actual unminified JS code generating an error, for example instead of unhelpfully telling you that its on line one of a garbled mess of JS because everything is on line one ;).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.