SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm experimenting with using CSOM and Web Workers as many of my users use Chrome and FireFox. Currently I am importing SP.js and SP.Core.js

importScripts("../SP.js", "../SP.Core.js");

What other scripts do I need to import? Currently I am getting the error

Type is not defined.

Any advice would be appreciated.

share|improve this question
up vote 3 down vote accepted

If you add a reference to /_Layouts/MicrosoftAjax.js you no longer get the Type is not defined error. The problem then becomes that Type is defined as inheriting from window.

Type Class

Provides a typing and type-reflection system for ECMAScript (JavaScript) object-oriented programming functionality.

Namespace: None. The Type methods are global and not part of a namespace.

Inherits: window.

Of course, a Web Worker does not have access to the window object. So it appears that it is not possible to use the CSOM with a Web Worker.

Window, Self, and Web Workers

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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