0

There is a conflict between SharePoint and monotools.js . SharePoint tries to use the method: Type.registerNamespace and monotools.js register a function with the name Type as well. If you call the monotools before some files are loaded it causes the problems:

Uncaught TypeError: Type.registerNamespace is not a function

in files like sp.ui.socialribbon in SharePoint 2013.

Is there a workaround for this kind of conflict ?

1
  • Is below given information make sense ?
    – Hardik
    May 16, 2016 at 15:18

2 Answers 2

0

You have to register different namespaces for both applications in you code.

Please check below mentioned links for the reference.

What are the Type.registerNamespace advantages over standard JavaScript methods?

CSR + MDS, where are my globals going?? (and I want them back!)

4
  • Hi @Hardik, thanks for your answer. I understand there is a conflict on the namespace. Sorry if I didn't explain that part, but I have two big frameworks that I would like to change them as litle as possible. In one side many sharepoint js files that uses this namespace and in other side one big file from monotools that uses the same namespace. this.Type, I would like to know more specifically if the mono tools have a way to overcome this conflict easier, like it has with jQuery for example. It identifies if the $ is already used, if it is, it will use a different sign.
    – Tito
    May 16, 2016 at 19:06
  • I didn't find another way more elegant them changing the Type var and it's usage from the monotools-core.js file to TypeMonotools. It took me time, since the file is more than 1k lines of code, but it worked out.
    – Tito
    May 17, 2016 at 13:19
  • 2
    The answer Hardik gives points to some of my ramblings which are not a solution to your problem (so should not be marked as correct answer). As you identified yourself its a Type Namespace conflict between the 2 libraries, and your less then elegant solution is your only escape I am afraid. You can answer your own question and mark it as the correct answer May 17, 2016 at 15:55
  • @DannyEngelmanNVP thanks for your comment, I even found a better way to do it (less work). If I have the minified version of the mootools file, the changes on the variable name will be only in 3 places.
    – Tito
    May 18, 2016 at 12:50
0

I took the minified version of the mootools file and changed it in only 3 places, instead of many, like on the not minified version. Not an elegant solution, but I couldn't find a better way.

Your Answer

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

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