Cannot read property 'app' of undefined

Hi, guys,
I want create a AR Map. So I create a project with AR(8the wall) and Leaflet.js. But when I add leaflet.css to document’s head,the AR script has error.
Does anyone know how to solve it?

my project is https://playcanvas.com/editor/scene/1277245

------------error info-------------
XR threw an exception

[playcanvas.dbg.js?version=1.49.4:73711]: Cannot read property 'app' of undefined

TypeError: Cannot read property 'app' of undefined
    at scriptType.initScriptType (https://launch.playcanvas.com/editor/scene/js/engine/playcanvas.dbg.js?version=1.49.4:73711:20)
    at new scriptType (https://launch.playcanvas.com/editor/scene/js/engine/playcanvas.dbg.js?version=1.49.4:73810:40)
    at A.exports (xrweb.js:42:173645)
    at xrweb.js:42:141028
    at Object.run (xrweb.js:42:141288)
    at Object.run (xrweb.js:25:342721)
    at I (xrweb.js:42:281958)
    at Object.runXr (xrweb.js:42:282313)
    at Object.onxrloaded (https://launch.playcanvas.com/api/assets/files/scripts/XRController.js?id=60900306&branchId=cde1aec6-d7be-4171-9f1f-cc31d56f3c65:21:20)
    at Object.P [as showLoading] (https://cdn.8thwall.com/web/xrextras/xrextras.js:1:62493)

TypeError: Cannot read property 'app' of undefined
at scriptType.initScriptType (https://launch.playcanvas.com/editor/scene/js/engine/playcanvas.dbg.js?version=1.49.4:73711:20)
at new scriptType (https://launch.playcanvas.com/editor/scene/js/engine/playcanvas.dbg.js?version=1.49.4:73810:40)
at A.exports (xrweb.js:42:173645)
at xrweb.js:42:141028
at Object.run (xrweb.js:42:141288)
at Object.run (xrweb.js:25:342721)
at I (xrweb.js:42:281958)
at Object.runXr (xrweb.js:42:282313)
at Object.onxrloaded (https://launch.playcanvas.com/api/assets/files/scripts/XRController.js?id=60900306&branchId=cde1aec6-d7be-4171-9f1f-cc31d56f3c65:21:20)
at Object.P [as showLoading] (https://cdn.8thwall.com/web/xrextras/xrextras.js:1:62493)

That looks like it is in the 8th Wall library code so you are best off asking on their Slack channel/support

Thanks for your reply.

Is there another away to add online js and css to playcanvas?
just like Quick Start Guide - Leaflet - a JavaScript library for interactive maps

Hi @luhaohui,

To add HTML and CSS UI to your PlayCanvas application, you can refer to this tutorial. If you wish to add external JS libraries, like leaflet, you can add the CDN to the ‘external scripts’ section in your project settings.

Hi @DevilZ
The ‘external scripts’ can add URL for js. But how can I add CSS?

------ external scripts’s user-manual-------
Here you can specify the URLs of external scripts you would like to include in your application. These URLs are added as script tags in the main HTML page of the application before any other script is loaded.

CSS and HTML assets must be uploaded in your project’s asset panel. Please refer to the tutorial I have linked in my previous post to see how this is done.

Hi @DevilZ
Thanks for your advice.

CSS and HTML assets must be uploaded in your project’s asset panel.

Yes, I did by this way. But the AR has errors. So, I wander if there are another ways to add css and js to the project.

Do other CSS files work? If so, it’s most likely an error with 8th wall, in which case you would probably want to approach their support team.