# Aurelia-ui-framework error adding plugin in main.ts

**URL:** <https://discourse.aurelia.io/t/aurelia-ui-framework-error-adding-plugin-in-main-ts/2906>\
**Category:** Help Requests\
**Created:** [September 5, 2019, 11:35pm UTC](https://discourse.aurelia.io/t/aurelia-ui-framework-error-adding-plugin-in-main-ts/2906 "2019-09-05T23:35:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![KPLATTER](https://avatars.discourse-cdn.com/v4/letter/k/839c29/32.png) [@KPLATTER](https://discourse.aurelia.io/u/KPLATTER)\
**Post date:** [September 5, 2019, 11:35pm UTC](https://discourse.aurelia.io/t/aurelia-ui-framework-error-adding-plugin-in-main-ts/2906/1 "2019-09-05T23:35:16Z")

</div>

@bigopon - I see that you are a contributor on the aurelia-ui-framework, do you have any idea why I would be receiving the error:

`Possible Unhandled Promise Rejection: TypeError: Cannot read property 'attrToRemove' of undefined`

when adding the plugin into main.ts? I have tried using useResource and am able to add UIResources.Buttons and UIResources.Menus ok, but the error happens when adding UIResources.DataPanel. I am trying to use the grid and it is part of the DataPanel.

---

<div class="post-metadata">

**Author:** ![avrahamcool](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/avrahamcool/32/368_2.png) [@avrahamcool](https://discourse.aurelia.io/u/avrahamcool)\
**Post date:** [September 7, 2019, 8:41pm UTC](https://discourse.aurelia.io/t/aurelia-ui-framework-error-adding-plugin-in-main-ts/2906/2 "2019-09-07T20:41:54Z")

</div>

to fix this, you need register `aurelia-ui-virtualization` in your `main.ts` (it should be before `aurelia-ui-framework`)

---

<div class="post-metadata">

**Author:** ![KPLATTER](https://avatars.discourse-cdn.com/v4/letter/k/839c29/32.png) [@KPLATTER](https://discourse.aurelia.io/u/KPLATTER)\
**Post date:** [September 8, 2019, 10:59pm UTC](https://discourse.aurelia.io/t/aurelia-ui-framework-error-adding-plugin-in-main-ts/2906/3 "2019-09-08T22:59:25Z")

</div>

Thanks, that resolved the issue.

---

<div class="post-metadata">

**Author:** ![KPLATTER](https://avatars.discourse-cdn.com/v4/letter/k/839c29/32.png) [@KPLATTER](https://discourse.aurelia.io/u/KPLATTER)\
**Post date:** [September 9, 2019, 2:01am UTC](https://discourse.aurelia.io/t/aurelia-ui-framework-error-adding-plugin-in-main-ts/2906/4 "2019-09-09T02:01:49Z")

</div>

Well I guess I spoke too soon. It seems to have gotten rid of that error, but now after adding in the .useResource(UIResources.DataPanel) I am getting this error.

`index.js?f309:248 Possible Unhandled Promise Rejection: TypeError: Cannot read property 'attrToRemove' of undefined at ViewCompiler._compileElement (aurelia-templating.js?78cb:3081) at ViewCompiler._compileNode (aurelia-templating.js?78cb:2776) at ViewCompiler._compileElement (aurelia-templating.js?78cb:3096) at ViewCompiler._compileNode (aurelia-templating.js?78cb:2776) at ViewCompiler._compileNode (aurelia-templating.js?78cb:2798) at ViewCompiler.compile (aurelia-templating.js?78cb:2745) at eval (aurelia-templating.js?78cb:3479) at eval (index.js?f309:57) at run (setImmediate.js?bdcd:40) at runIfPresent (setImmediate.js?bdcd:69)`

@avrahamcool, I don’t have anything in my html file that would be throwing it off. I have tried it with a grid in the html file as well.

---

<div class="post-metadata">

**Author:** ![avrahamcool](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/avrahamcool/32/368_2.png) [@avrahamcool](https://discourse.aurelia.io/u/avrahamcool)\
**Post date:** [September 9, 2019, 5:36am UTC](https://discourse.aurelia.io/t/aurelia-ui-framework-error-adding-plugin-in-main-ts/2906/5 "2019-09-09T05:36:43Z")

</div>

Please share the content of your ‘main.ts’ file.

---

<div class="post-metadata">

**Author:** ![KPLATTER](https://avatars.discourse-cdn.com/v4/letter/k/839c29/32.png) [@KPLATTER](https://discourse.aurelia.io/u/KPLATTER)\
**Post date:** [September 9, 2019, 2:12pm UTC](https://discourse.aurelia.io/t/aurelia-ui-framework-error-adding-plugin-in-main-ts/2906/6 "2019-09-09T14:12:41Z")

</div>

`  
import ‘aurelia-ui-virtualization’  
import {Aurelia} from ‘aurelia-framework’  
import environment from ‘./environment’  
import {PLATFORM} from ‘aurelia-pal’  
import { UIFrameworkConfig, UIResources } from “aurelia-ui-framework”

export function configure(aurelia: Aurelia) {  
aurelia.use  
.standardConfiguration()  
.feature(PLATFORM.moduleName(‘resources/index’));

aurelia.use.developmentLogging(environment.debug ? ‘debug’ : ‘warn’);

aurelia.use.plugin(PLATFORM.moduleName(“aurelia-ui-framework”), (config: UIFrameworkConfig) =\> {  
config  
.useResource(UIResources.Buttons)  
.useResource(UIResources.DataPanel)  
});  
// .setApiBaseUrl("/api")  
// .useResource(UIResources.DataPanel)  
// .useResource(UIResources.Buttons)  
// .useStandardResources();

if (environment.testing) {  
aurelia.use.plugin(PLATFORM.moduleName(‘aurelia-testing’));  
}

aurelia.start().then(() =\> aurelia.setRoot(PLATFORM.moduleName(‘app’)));  
}  
`

---

<div class="post-metadata">

**Author:** ![avrahamcool](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/avrahamcool/32/368_2.png) [@avrahamcool](https://discourse.aurelia.io/u/avrahamcool)\
**Post date:** [September 9, 2019, 5:55pm UTC](https://discourse.aurelia.io/t/aurelia-ui-framework-error-adding-plugin-in-main-ts/2906/7 "2019-09-09T17:55:49Z")

</div>

remove `import ‘aurelia-ui-virtualization’`.  
instead - register the virtualization plugin - before `aurelia-ui-framework`

aurelia.use.plugin(PLATFORM.moduleName(“aurelia-ui-virtualization”);  
aurelia.use.plugin(PLATFORM.moduleName(“aurelia-ui-framework”) …
