cancel
Showing results for 
Search instead for 
Did you mean: 

Uncaught TypeError: Cannot read property 'ViewType' of undefined

06-21-2013 9:02 PM
alex_hsu Product and Topic Expert
3200 views 12 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

Hi,

I just installed SAPUI5 in my eclipse juno (following the steps described in the link http://scn.sap.com/community/developer-center/front-end/blog/2013/06/01/how-to-install-a-basic-devel... and tried to write a simple test app and deployed it.

When I run my app in Tomcat 6, I got this error shown below and I have no idea what the root cause for this error.

Can someone help me out if you have encountered the same problem in the past?

Thanks,

Alex

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

Hi Alex,

Its possible that the application is not able to load the SAP UI5 resources.

try adding a preceding "/" in the src tag...

example

src="/sapui5/resources/sap-ui-core.js"

You could also check which is about a similar issue.

Regards

Tufale Ashai

alex_hsu
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Tufale,

Thanks for your reply.  I had found this discussion thread before as well and tried it, unfortunately it didn't work to me as well.

Today I use FireFox to debug and notice an "not well-formed" error when reading the file "library-preload.json".  Could this be a problem?

Thanks,

Alex

GrahamRobbo
SAP Mentor
SAP Mentor
0 Likes

Hi Alex,

it is possible you have a corrupted SAPUI5 library. You can get the latest from the repo at https://tools.hana.ondemand.com/juno

I think all you need to do is update the location you specified in step 6 for the SAPUI5 plugin to the above URL and then do Help->Check for Updates.

Cheers

Graham Robbo

alex_hsu
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Graham,

Thanks for your reply.  I had also tried this by downloading the latest version from this link and install them into a brand new Windows 7 VMWare image.  Same problem occurred.

Best Regards,

Alex

GrahamRobbo
SAP Mentor
SAP Mentor
0 Likes

Well in that case I have no idea why you are getting this issue - especially why you are getting it after a complete reinstall.

The only other thing I can suggest is that you load the debugging libraries to see if they reveal more details about this problem in the console log.

You do this by replacing the reference to resources/sap-ui-core.js with resources/sap-ui-core-dbg.js

Cheers

Graham Robbo

alex_hsu
Product and Topic Expert
Product and Topic Expert
0 Likes

Thanks, Graham.

After I change into debugging mode, the error becomes obvious.

The issue could be that the line shows some strange characters at the end.  Is this an unicode problem in this javascript?

How can I resolve this?

Best Regards,

Alex

GrahamRobbo
SAP Mentor
SAP Mentor
0 Likes

No idea - even regular regular expressions baffle me.

Have you tried other browsers to see if it a browser specific problem?

alex_hsu
Product and Topic Expert
Product and Topic Expert
0 Likes

I found the solution.  Just add charset="utf-8" in the <meta ....> and the issue would be gone.

GrahamRobbo
SAP Mentor
SAP Mentor
0 Likes

Well done

Answers (2)

Answers (2)

Former Member
0 Likes

Many thanks Alex, that was also what I have looked for

Best Regards,

Cengiz

Former Member
0 Likes

Hi Alex,

I have gone through your code.

I think you should replace your code where you have written your view names.

follow the code.

view Name:"personList-web-(here you write your view name other than your content folder)"

Hope this will help you

Regards

Gouri Shankar

alex_hsu
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Gouri,

Thanks for your reply.  Actually this index.html file was generated by SAPUI5 when I created a new project for SAPUI5 Application.  I didn't even put any line of my code yet.

Best Regards,

Alex