Angular 2 RC5 webpack source maps misaligned for debugging - google-chrome

Since upgrading to RC5, when debugging in Chrome dev tools, breakpoints are hit, but the debugger identifies the line as several to many lines later (in this case 15 lines!). In the screenshot the "current" line is actually the line where debugger; is present. This is making debugging very difficult. This is in combination with webpack. It works, but you have to interpret things manually rather than seeing exactly which line is executing. It appears to only do this on my ts files, not on the angular code if I debug into it.
I'd love ideas on the source of this problem and how to fix it.
Chrome 52
webpack 1.13.1 with config.devtool = "source-map"
If you set config.devtool to eval all is correct. But any other value seems to have the offset issue.
Angular 2 RC5

I was facing the same problem. The solution that was given to me was to uninstall the npm version of the angular-cli and reinstall the Github one by running the following:
npm uninstall --save-dev angular-cli
and then
npm i --save-dev github:angular/angular-cli#a8d7c0a9a0c1657db2a673c42bfbaa51fde2a466

Related

Live Sass Compiler causing Extension Host crash after latest VSCode

I am trying to use sass styling and Live Sass Compiler extension, I recently installed it and now keep getting a extension host terminated unexpectedly error using VS Code.I have re-installed Live Sass Compiler several times as well as all my Live extensions and restarted my VS Code. Live Extensions I've re-installed. I know its the Live Sass Compiler causing this issue, because once I uninstall, I don't see the error anymore, but I can't update any styling in my . scss files. Everything is up to its current version.
How can I keep using Sass if this extension isn't working? Sass extension error Thank you!
This has been bothering me for so bloody long... Turns out (for me anyway) it was the extension "Color Highlight" that was causing it to crash. I'm going to be very careful downloading random extensions in the future..
for my situtation it blocks me only when I import a partial scss file so disabled it and only enable it when i have no more partial files to import.
color highlight is very useful for me.
or you can use the npm module "node-sass" with the flag -w
This is the exact issue I'm facing currently while using the "Live Sass Compiler". Whenever I try to edit any "#import" lines it just gives me the error.
See this image ... Extension host termination error!
Problem:
I'm facing this issue only while using the "Live Sass Compiler" as you can see in the screenshot ... Error in detail. This is similar to the one you're getting.
Quick Fix:
There must be some interruptions in the process due to which the extension is causing this error. Now, continue using the sass compiler and getting rid of that error I would suggest you uninstall the "Live Sass Compiler" and instead use npm install node-sass --save-dev to install the node-sass compiler as a dependency. Now in package.json enter the required script for node-sass to run.
This will allow you to compile .scss files to css. For more info checkout this link "https://www.npmjs.com/package/node-sass".
Hope you got your answer,
Cheers!

How do I use electron-compile?

I'm having trouble with electron-compile.
The docs state
How does it work? (Easiest Way)
Change your reference to electron-prebuilt to electron-prebuilt-compile. Tada! You did it.
What reference, where? You can't be talking about package.json?
I've always run electron using supervisor -x "electron" -i "./" .
What am I completely missing / what should be the contents of my pull request to make this clearer?
I've installed electron-compile with npm i electron-compile --save-dev
I'd like to have es2015/jsx precompiled to es5, so that I can run a react application in electron. electron-compile appears to solve this problem.
You should install Electron as a dev reference in package.json, yes:
npm install --save-dev electron-prebuilt-compile
Don't install Electron as a global because then other people have to set stuff up to run your app (i.e. they now have to micromanage which version of Electron they have installed globally)
With the recent versions (electron 1.3.5), I was unable to get electron-prebuilt-compile working, well it works for development but packaging for production has no real working examples.
It seems the compiling and packaging needs to be done manually, so in case anyone needs a working example, it's here. Hope to save someone some time and pain.

Aurelia bundle with gulp throws "TypeError: Path must be a string. Received undefined"

I'm using the skeleton-typescript aurelia skeleton-navigation package, when running gulp bundle it gives me an error that says path must be a string but was undefined
TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.basename (path.js:801:5)
at exports.writeOutputs (C:\Users\joaoe\Desktop\skeleton-navigation\skeleton-typescript\node_modules\systemjs-builder\lib\output.js:137:23)
at C:\Users\joaoe\Desktop\skeleton-navigation\skeleton-typescript\node_modules\systemjs-builder\lib\builder.js:575:14
at tryCatcher (C:\Users\joaoe\Desktop\skeleton-navigation\skeleton-typescript\node_modules\systemjs-builder\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (C:\Users\joaoe\Desktop\skeleton-navigation\skeleton-typescript\node_modules\systemjs-builder\node_modules\bluebird\js\release\promise.js:502:31)
All gulp related files can be found here since there are more than one.
Even the cloned package throw that.
I'm running Node 6.0.0 and tested with 5.9.1, on Windows 10.
There is some property that I need set to be that path ? Seems related to Aurelia pre built tasks, from comments could also be an environment problem.
As I tracked it down, the issues seems to be an ugly combination of node-gyp, Windows and node 6
So install all dependencies needed for node-gyp, following your OS steps as seen at official repo. Unfortunately for now if you are running Windows is likely that you need to install Visual Studio. Then run npm install on the repository and see if there is any error, should be no one now. Then try to gulp bundle it should work now. With downgraded node to 5.11 I was able to run again, I did not test with node 6 but feel free to try.

Are there any code complexity metering tools that work well with ES6?

My project is ES6 (webpack + babel). Plato is great, but doesn't work with ES6 yet. I took a look at escomplex and the series of related packages, but it looks like the author is no longer maintaining this and it seems like it doesn't support ES6 anyways.
I'm using the ESLint complexity rule to at least warn me if there's an issue (it's set to warn at 6), but it's not the same as a pretty report.
Any suggestions?
There is a fork created by deedubs that uses espree instead esprima. I've installed it and it runs on ES6 styled code like a charm, in order to install the fork version instead the default distro execute the following command:
npm install -g git+https://github.com/deedubs/es6-plato.git
Whenever you want to uninstall it just do it like you would do it with vanilla plato install by writing
npm uninstall plato
Here's a screenshot for a file report based on a ES6 code after installing the Plato forked version
It's been about 3 weeks since you asked the question so I am not sure if this will be still useful for you but I hope it can help others with the same problem we were facing on using this amazing tool.
I published a version of plato that does this here: https://www.npmjs.com/package/es6-plato
updates lodash and dependencies
fixes some common bugs in plato
properly parses es6
this includes classes
npm install --save es6-plato
read the docs to use it with gulp, or via the js api.

Visual Studio 2015 - Where's the gulp task runner?

I heard Mads Kristensen in his videos mention that Gulp and Grunt are both first class citizens. I thought I even heard mention of the Gulp task runner.
But when I create a gulpfile and right click there's no task runner.
Has anyone been able to get the "native" gulp task runner (if there is one) in Visual Studio 2015 Preview to appear?
View > Other Windows > Task Runner Explorer and click refresh
or just Ctrl + Alt + Bkspace
The Preview version of VS2015 requires Gulp to be installed globally and has a few other issues with auto-discovery of the gulpfile.js. These issues will all be addressed by the time VS2015 ships.
I had this same problem with VS2015 - TRX was showing "no tasks found" even though I had a valid, linted, gulpfile.js in the site root. I found the answer here: http://www.roelvanlisdonk.nl/?p=4258
Steps: Close VS. Open a cmd prompt from the site root and run npm install. Re-open VS and you should see your tasks in TRX. It worked for me.
EDIT: I had gulp installed globally but still encountered this "error." The above steps resolved the issue though.
Well I solved the problem with several restarts of VS2015. Finally the task runner appeared for my gulpfile. I still have no idea why it did not appear from the start but it's a preview version so maybe something is not quite right yet.
Barryman9000's answer helped me on the right track. I started with an empty ASP.NET 5 project in VS2015 and had no package.json file at the project root. Running npm install gave me an error message about missing package.json. After adding that file with the default dependencies from another ASP.NET 5 project, the Dependencies started downloading and my gulpfile tasks appeared in the Task Runner Explorer.
In your bash, go to the directory gulpfile.js is installed in and run:
npm install gulp
Why the downvotes? Please read the OP's question and the comments beneath it. Also, note that the answer with, currently, the most points has nothing to do with the question. Also please note that Mads Kristensen himself said that the issue was to install gulp.
Also, as for the commenter "Bonner" of this answer, note that Bash doesn't mean Linux. You can install git bash for Windows and run all of your NPM and Git commands there. Most developers I know use that bash on windows for all npm needs.
Lastly, if your Gulp Task Runner is not working, that is most likely because it is not recognizing your gulpfile. That is due to gulp not being installed. VS2015 didn't always install gulp for you. So the fix was to install gulp globally (As Mads Kristensen said), or directly where your gulpfile is. Also, restarting or re-installing VS sometimes kickstarted the gulp installation if you're lucky.
Conclusion: My answer is the correct answer. I reference the actual OP Question, comments beneath it, Mads Kristensen, and even the accepted answer. Yet, this answer is in the negative and some random answer about how to use the "View" menu in Visual Studio has 40 points.