Select to view content in your preferred language

Upgrading from 2.8 to 3.1

823
3
08-15-2012 01:16 PM
KevinGooss
Regular Contributor
My site breaks when i upgrade api versions from 2.8 to 3.1
I see many posts in here that error with esri not defined.
i don't think that is my issue and i have taken great pains to not reference esri.* outside of dojo.ready.
My issue is that the api does not appear to load properly, i never even hit dojo.ready.
When i have the 2.8 api I see files like this being loaded:

http://serverapi.arcgisonline.com/jsapi/arcgis/2.8/js/dojo/dojox/gfx/svg.xd.js

but when i have the 3.1 api these calls error out and i see it is trying to load that resource from here instead:

http://myserver.com/dojox/gfx/svg.js

Why would it be looking local to find this? it is doing likewise for jsapi_en-us.js and Dialog.jsa nd number.js
I get 6 or 7 errors on load.

Anybody seen this before?
Could it have anything to do with my module path:

  
<script type="text/javascript">djConfig = { parseOnLoad: true,usePlainJson: true, baseUrl: "", modulePaths: { "tg": "JGF/js/jg"}}</script>
    <script type="text/javascript" src="https://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.1"></script>
0 Kudos
3 Replies
derekswingley1
Deactivated User

Could it have anything to do with my module path:

  
<script type="text/javascript">djConfig = { parseOnLoad: true,usePlainJson: true, baseUrl: "", modulePaths: { "tg": "JGF/js/jg"}}</script>
    <script type="text/javascript" src="https://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.1"></script>


Yes, that's likely it and the fix is outlined in our migrating to 3.0 doc. The key point is that baseUrl and modulePaths have been replaced by packages. The switch is pretty straightfoward. Details in the migration doc.
0 Kudos
KevinGooss
Regular Contributor
That did the trick thanks. That regex expression does work - but visual studio is not very happy with the escaping.
thanks.
0 Kudos
derekswingley1
Deactivated User
Glad you're in business. I don't use visual studio :).
0 Kudos