aurelia / documentation

The documentation for Aurelia.
MIT License
105 stars 111 forks source link

ValueConverter files must not contain exported functions #351

Closed ModernRonin closed 2 years ago

ModernRonin commented 7 years ago

The documentation for ValueConverters should state that you must not put exported functions (Typescript - not sure what's the equivalent syntax in ESnext) into files containing ValueConverters, at least not when said files are added to the globalResources array. If you do, you get a somewhat mystifying error message:

plugin.load is not a function

That info should be put into a huge red box or the like, so you cannot overlook it. Just cost me half an hour :)

(Eventually, it would be better for whatever piece of code is unhappy about such functions to output a proper error.)

Cheers, Max

Alexander-Taran commented 6 years ago

what would be the case for putting an exported function in a module with value converter? I mean how did you discover this?

bigopon commented 6 years ago

+1 to what @Alexander-Taran said, would be nice to see how you are declaring / consuming your value converter @ModernRonin

Alexander-Taran commented 2 years ago

@bigopon 🤷‍♂️