SteveSanderson / generator-ko

63 stars 39 forks source link

Babel not works correctly #19

Open vamp opened 8 years ago

vamp commented 8 years ago

if (!babelCore.canCompile(pathname)) return callback(); returns error:

stream.js:94
      throw er; // Unhandled stream error in pipe.
            ^
TypeError: undefined is not a function
    at babelTranspile (...\gulpfile.js:134
:20)
MarkDeVerno commented 8 years ago

I'm having the same issue. There were some major changes to babel recently.

sdluxeon commented 8 years ago

@MarkDeVerno what was your fix?

chrconlo commented 8 years ago

Anybody find a solution for this? Spent several hours setting this up only to hit issue #24 (which would be good to resolve). Trying to workaround by compiling via Gulp but breaks here.

MarkDeVerno commented 8 years ago

@chrconlo @sdluxeon I gave up on a fix and just rolled back to a previous version.

chrconlo commented 8 years ago

Yes, I went back to Nov 2014 commit and used npm link from local copy and all works well now. Thanks

paulbonner commented 8 years ago

chrconlo is right. Rolling back to d88af3ad72d72e907c5d681e38ab6c7ebf06acd6 is the answer.

Kevinio04 commented 8 years ago

Hey guys, there is a fix to this I found on SO. Well... there is a fix to getting the Gulp build to work anyway. Its a pretty simple fix and relates to how slashes are handled between windows and OSX.

At the top of gulpfile.js you need to add the following variable to the gulp and plugins variables: slash = require('slash');

Then at the bottom of the file edit the babelTranspile function. Add a new line at the top of the function and paste the following: pathname = slash(pathname);

This will allow the build to execute and the application will load from the dist folder. I have no idea how steve is running from the src folder in the demo however. No browsers support ES6 so the imports declarations in the startup file in my mind will never work, they would have to be updated to ES5 require statements.

Original answer to the gulp problem found here:

http://stackoverflow.com/questions/33198584/gulp-failing-default-task-due-to-jquery-error-for-generator-ko

dipaktelangre commented 7 years ago

@Kevinio04 I spend almost day to resolve same issue. Thanks for your solution, its works :) 👍