none
I get undefined javascript script name error

    Question

  • This is a brand new Outlook/Office app project created in Visual Studio 2012. I haven't added any code. The template is supposed to load 

    Subject: 
    From: 
    To:

    But it doesn't load any. I looked into the console in chrome, and here is what I get:


    Thursday, December 19, 2013 6:00 PM

Answers

  • Thanks Pallav. This is not a localhost issue. It was happening on our production app too. The reason I gave a localhost example is because I wanted to show you that even when I started a new project from scratch, the problem still existed. I fixed it by replacing the office.js file with a newer version. I was using 15.0.4431.1000, I now updated it to use 15.0.4515.1000. 
    • Marked as answer by Amre Saadeh Friday, February 14, 2014 10:50 PM
    Friday, February 14, 2014 10:50 PM

All replies

  • I think it's Path issues..file is not proper finding here!!!
    Thursday, December 19, 2013 6:02 PM
  • The file will not be found because the path is wrong. That makes sense. But the question is why does office.js produce a url that contains "undefined"? 
    • Edited by Amre Saadeh Thursday, December 19, 2013 6:37 PM
    Thursday, December 19, 2013 6:36 PM
  • Hi Amre,

    According to the screenshot you provide, I notice that the URL begins with https. I think this may be caused by the security setting on the machine. I suggest you changing the source location to the http link like figure below:

    We can get the location from property of Web Application project like figure below:

    Does this fix the issue? If not please feel free to let me know.

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, December 20, 2013 11:09 AM
  • Hi Fei,

    It was not set to https.

    The problem suddenly started happening in our live outlook app. I'm trying to debug the problem.

    Our live/production outlook app loads fine in the Outlook desktop client app but it does not load in the web app. The same console messages are printed when trying to load our live app.

    Thanks!

    Monday, December 30, 2013 12:05 AM
  • Hi,

    The probable cause for this  could be following :

    1. The version of Chrome is not compatible, so you should try loading Outlook Web App in IE 10 or higher version of Firefox.

    2. Due to CORS, restriction, files are not loaded from localhost in your Web APP. Try using the CDN for scripts below in you app.


    https://appsforoffice.microsoft.com/lib/1.0/hosted/office.js

    As far as undefined URL is concerned, it is because, in Office.js,  clientEndPoint function is unable to resolve the script path.

    In your app use the debug version of Office.js and debug the line below

    clientEndPoint.invoke("getCustomizedScriptPathAsync",

    You can get your endpoint url, which you can post back here. You can use the the URL below for debug version of Office.js

    https://appsforoffice.microsoft.com/lib/1.0/hosted/office.debug.js

    Regards,
    Pallav[Not MSFT]

    Wednesday, January 15, 2014 11:01 AM
  • Thanks Pallav. This is not a localhost issue. It was happening on our production app too. The reason I gave a localhost example is because I wanted to show you that even when I started a new project from scratch, the problem still existed. I fixed it by replacing the office.js file with a newer version. I was using 15.0.4431.1000, I now updated it to use 15.0.4515.1000. 
    • Marked as answer by Amre Saadeh Friday, February 14, 2014 10:50 PM
    Friday, February 14, 2014 10:50 PM