title: mismatched anonymous define() module typescript with AMD and export module
body: <p>I am trying to create an application using Typescript(1.7.5) and AMD module. I have added reference to r.js and requirejs.js. below is my TS code:</p>
  
  <pre><code>export module TestNs {
      export class TestClass {
          public fn(): void{
              debugger;
          }
      }
  }
  </code></pre>
  
  <p>here is my aspx page to call "fn()":</p>
  
  <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TypeScriptPage.aspx.cs" Inherits="WebApplication1.TypeScriptPage" %&gt;
  
  &lt;!DOCTYPE html&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
      &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
          &lt;div id="div1"&gt;
          &lt;/div&gt;
          &lt;script src="Scripts/r.js"&gt;&lt;/script&gt;
          &lt;script src="Scripts/require.js"&gt;&lt;/script&gt;
          &lt;script src="Scripts/TypeScriptBegin.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript"&gt;
  
              var testObj = new TestNs.TestClass();
              testObj.fn();
  
          &lt;/script&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>but I am getting below errors:</p>
  
  <p><strong>TestNS is undefined</strong></p>
  
  <p><strong>"JavaScript runtime error: Mismatched anonymous define() module: function (require, exports)"</strong></p>
  
  <p>however when I remove <strong><em>"export"</em></strong> keyword, above code works fine. I am new to Typescript and requirejs. Can anyone point out what I am doing wrong and how to fix this?</p>
  
  <p>thanks in advance.</p>