esri-loader.js generates

242
0
07-15-2020 07:06 PM
FardoshtAmirpanahi2
New Contributor

I am working on a web application which used Vue framework. I am following the code snippet in this link to authenticate the user.

Access ArcGIS Online items using OAuthentication | ArcGIS API for JavaScript 4.16 

Below is my version.

<script>
import { loadModules } from 'esri-loader'
export default {
name: 'Home',
selectedAgol: '',
data () {
return {
}
},
mounted(){
loadModules('esri/identity/IdentityManager', 'esri/identity/OAuthInfo').then(([esriId, OAuthInfo]) => {
const info = new OAuthInfo({
appId: "fdksdofiwue3wmerf",
portalUrl: "https://www.arcgis.com/sharing/rest/oauth2/authorize/",
popup: false
});
esriId.registerOAuthInfos([info]);
esriId
.checkSignInStatus(info.portalUrl + "/sharing")
.then(function () {
displayItems();
})
.catch(function () {
// Anonymous view
anonPanelElement.style.display = "block";
personalPanelElement.style.display = "none";
});
})
}
}
</script>

The script generates the following error.

Uncaught (in promise) Error: undefinedModule
at p (dojo.js:5)
at ba (dojo.js:11)
at v (dojo.js:5)
at eval (esri-loader.js?31e8:237)
at new Promise (<anonymous>)
at requireModules (esri-loader.js?31e8:234)
at loadModules (esri-loader.js?31e8:268)
at VueComponent.mounted (Home.vue?5584:492)
at invokeWithErrorHandling (vue.esm.js?efeb:1863)
at callHook (vue.esm.js?efeb:4228)

I very much appreciate any suggestion you may have. 

0 Kudos
0 Replies