1

i am writing a multi-file typescript web application. I have my core application code in a file called application.ts which I want to be called upon by my main (data-main) file is called applicationEntry. when I do declare module 'application' in my application.ts file everything works great. but when I try to add import statements in my application.ts file I get an error: "Invalid module name in augmentation, module 'application' cannot be found.", I am confused on why this error would be thrown when I simply add an import statement. I've searched around the net for some answer's but have found minimal amounts if not on that truly fix's my issue. Perhaps I am structuring my application wrong? here is my script with the error:

here is what it looks like in applicationEntry:enter image description here EDIT: basically what my problem is: it works fine if the file that is including doesn't import anything whereas if it does import something other modules suddenly cannot import the module. also i should note the import im trying to add is a typings definition file.

1 Answer 1

1

You can use the code as below,

export module application
{
   export class Application
   {
      // Your code
   }
}

You need not declare the module.

Hope this helps!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.