Tyson
Tyson

Reputation: 721

Can I use ES6 modules in a Node.js application and debug it in Visual Studio?

I've tried building a basic node.js ES6 module test project in Visual Studio 2015. But I get build errors and cannot run or debug the application in VS.

Have I just came to the party too early?

If it's worth anything I have tried opening and building the project in both VS2013 (Update 3) and VS2015 RC.

I have installed:

Additionally, I have added Robert Penners () node.d.ts gist to get over the import syntax errors.

See: https://gist.github.com/robertpenner/7d48f184df1236c4fdca

I have uploaded the project for others to try: https://dl.dropboxusercontent.com/u/10159140/es6-modules-ts.zip

Upvotes: 1

Views: 1025

Answers (1)

mousetraps
mousetraps

Reputation: 11

Node Tools dev here. Thanks for reporting this. Indeed, we support the ES6 typescript target type.

That said, I'm running into issues running your app in the command line altogether with the latest versions of both node and io.js, so this may be a level of ES6 support mismatch between all the components at play here... Have you managed to successfully run your app in the command line (without the debugger)? Otherwise it may be related to this discussion: https://github.com/nodejs/io.js/issues/1000

Once you figure that out, be sure to set up your project with the right node.exe arguments (harmony flag and whatnot) in project properties, so Visual Studio knows how to run it too.

Hope that helps!

P.S. just an fyi - we've moved to GitHub now, so please post issues there (rather than on CodePlex) for the quickest responses. https://github.com/Microsoft/nodejstools

Upvotes: 1

Related Questions