Why does using accounts.ui.config cause my application to crash?

Code (as indicated in the ui-config documentation ):

Accounts.ui.config({ passwordSignupFields: 'USERNAME_AND_OPTIONAL_EMAIL' }); Error: TypeError: Cannot call method 'config' of undefined 
+6
source share
2 answers

I realized that the file created in your project (yourprojectname.js) is a client script. My problem was that I created a new file called "client.js", although I did not need to do this. Stupid to me!

Hope this helps someone else.

+5
source

If you have a client folder for client files, it will work to add it there. I just added it to the config.js file, which I added to the Client folder, and it works fine.

client / config.js

Accounts.ui.config({ passwordSignupFields: 'USERNAME_AND_OPTIONAL_EMAIL' });

+5
source

All Articles