Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sp.search.js and search.clientcontrols.js missing #7

Closed
SPWizard01 opened this issue Jun 28, 2019 · 8 comments
Closed

sp.search.js and search.clientcontrols.js missing #7

SPWizard01 opened this issue Jun 28, 2019 · 8 comments

Comments

@SPWizard01
Copy link

is there any specific reason this is missing?

my use case is to import search configuration.

koltyakov added a commit that referenced this issue Jun 28, 2019
@koltyakov
Copy link
Owner

Hi @SPWizard01,

No any particular reason.
Added, but can't test at the moment. Could you please try (sp-jsom-node@2.1.0)?
search should be explicitly added in the modules list.

const jsomSettings: IJsomNodeSettings = {
  modules: [ 'search' ]
};
new JsomNode(jsomSettings).init(authOptions);

@SPWizard01
Copy link
Author

something got messed up :D
(node:26780) UnhandledPromiseRejectionWarning: RangeError: Maximum call stack size exceeded
at Function.Object$getType [as getType] (C:...\node_modules\sp-jsom-node\jsom\spo\msajaxbundle.debug.js:450:38) and its only when i add search as dependency

i will investigate, oh and by the way "search" type is missing, typescript will complain :)

@koltyakov
Copy link
Owner

He he, was over optimistic to expect it works so easy.
Any investigations are appreciated. Thanks!
I’ll take a deeper look and add tests as well over the weekend.

@SPWizard01
Copy link
Author

ok, so i got it to work partially, without search.clientcontrols.js

registerNamespace('PS');

had to add this:
registerNamespace('Microsoft.SharePoint.Client.Search'); registerNamespace('Microsoft.Office.Server.Search');

now if i add:
registerNamespace('Srch'); <- this is all in search.clientcontrols.js it will the no longer give me maximum stack but rather cannot read property of undefined in here:

var $htmlEncode = SP.Utilities.HttpUtility.htmlEncode;

so i wonder how its possible because it should be available from:

SP.Utilities.HttpUtility.htmlEncode = function SP_Utilities_HttpUtility$htmlEncode(str) {

@SPWizard01
Copy link
Author

and if we add sp.init.js to dependencies it fails here:

ListContext.registerClass('ListContext');

@koltyakov
Copy link
Owner

I was managed to make it work. Please check just published v2.1.1
However, search.clientcontrols.js is still limited (SP.Utilities.HttpUtility is faked as an empty object) and I can't recall what was the issue including sp.init.debug.js.
Could you also elaborate on your use case of search.clientcontrols.js in Node.js app? Hands itching soo much to exclude search.clientcontrols.js.

@SPWizard01
Copy link
Author

i think you are right, this one is only for UI interactions(or so it looks), at least my use case is working without it, bad assumption from my side then :)

@koltyakov
Copy link
Owner

So I likely remove search.clientcontrols.js in the next version. Also considering it's only for UI part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants