Gunnar
Gunnar

Reputation: 359

MVC 4 mobile 1.3.1 line 26 0x800a138f - JavaScript runtime error Unable to set property mobile of undefined or null reference

  1. In Visual Studio 2012 pro, Update 2, Create MVC 4 web app project, select Mobile template
  2. Run: it's working properly
  3. Manage Nuget packages, update JQuery to 2.0.2
  4. Run: 0x800a1391 - JavaScript runtime error: '$' is undefined
  5. In App_Start->BundleConfig.cs, change "~/Scripts/jquery-1." to "~/Scripts/jquery-2."
  6. Run: JavaScript critical error at line 1, column 11 in /Scripts/jquery-2.0.2.min.map, SCRIPT1004: Expected ';'
  7. Manage Nuget packages, update ASP MVC 4
  8. Run: same error as in #6
  9. Manage Nuget packages, update JQuery Mobile to 1.3.1
  10. Run: same error as in #6
  11. In Views->Shared->_Layout.cshtml, moved @ Scripts .Render("~/bundles/jquerymobile" ) to end of head section
  12. Run: line 26 jquery.mobile-1.3.1.js, 0x800a138f - JavaScript runtime error Unable to set property mobile of undefined or null reference
  13. Manage Nuget packages, update JQuery UI (Combined) to 1.10.3
  14. Run: same error as in #12
  15. Manage Nuget packages, update ALL
  16. Run: same error as in #12

Has someone been naughty and not tested their latest nuget packages for compatibility? Seems like we're in Javascript library hell...

I also tried the jQuery Migrate plugin 1.2.1, with no joy.

Where did I go wrong? Any help would be greatly appreciated.

Upvotes: 2

Views: 2102

Answers (1)

Gunnar
Gunnar

Reputation: 359

I undid #11, putting the jquerymobile reference back into the body and then removed the two map files from the Scripts folder.

This fixed the problem. :)

Think Snow...

Upvotes: 1

Related Questions