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

@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.

1 Like

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

2 Likes

Thanks, that resolved the issue.

2 Likes

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.

1 Like

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

1 Like

`
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’)));
}
`

1 Like

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”) 


2 Likes