Why does RegisterModuleInit only take when the file is stored in the Style Library? I'm using MDS and my JSLink file only works the first time unless it is stored there.

I've tried putting it in:

  • /_layouts/15/jslinktest.js
  • /_layouts/15/testfolder/jslinktest.js
  • /SiteAssets/jslinktest.js
  • /SiteAssets/subfolder/jslinktest.js
  • /_catalogs/subfolder/jslinktest.js

With updated RegisterModuleInit references accordingly and the only place it actually works is in Style Library. What am I missing?

  • Do you perhaps have double links to jslinktest? I had one as a CustomAction and one as JSLink to the same file and that stopped everything working.. haven't investigated why yet Jul 9, 2016 at 19:30

1 Answer 1


My file is in Site Assets and it's working fine for me.

RegisterModuleInit("/SiteAssets/HideColumns.js", Hide); // CSR-override for MDS enabled site
  • Is it true if the site is not the root site of the Web Application ?
    – Steve B
    Apr 4, 2019 at 15:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.