Giter Club home page Giter Club logo

Comments (8)

dstokes avatar dstokes commented on August 22, 2024

Error stack for reference:

./node_modules/.bin/browserify test.coffee -t workerify

/Users/drewstokes/Code/lincx/axle/node_modules/workerify/node_modules/falafel/node_modules/esprima/esprima.js:3817
            throw e;
                  ^
Error: Line 1: Unexpected string
    at throwError (/Users/drewstokes/Code/lincx/axle/node_modules/workerify/node_modules/falafel/node_modules/esprima/esprima.js:1456:21)
    ...

from workerify.

shama avatar shama commented on August 22, 2024

You should be able to do browserify test.coffee -t coffeeify -t workerify but I just tried that and it doesn't work. I don't know why.

from workerify.

dstokes avatar dstokes commented on August 22, 2024

@shama browserify doesn't change the name of compiled coffeescript files, so the extensions are still .coffee which are subsequently excluded by the regex check in the first line of module.exports.

from workerify.

dstokes avatar dstokes commented on August 22, 2024

changing /\.js/ to /\.(js|coffee)/ fixes it, but if the file doesn't contain javascript, esprima fails and dumps a big stack trace. if that's not a problem, then simply changing the regex will do the trick :)

from workerify.

hughsk avatar hughsk commented on August 22, 2024

@dstokes the order is important when you specify your transforms. If you pass -t coffeeify -t workerify instead of -t workerify -t coffeeify your CoffeeScript will be compiled to JS before getting handled by workerify and it should work without any errors. That's the only workaround without changing Browserify at the moment :)

from workerify.

dstokes avatar dstokes commented on August 22, 2024

@hughsk yeah, I tested that. The file is properly transformed to js, but workerify checks the file (module) name's extension before parsing. Browserify does not change the string used in require statements (i.e. - 'thing.coffee') and thus, workerify skips it.

from workerify.

shama avatar shama commented on August 22, 2024

@dstokes Added coffee to the extensions it accepts and using browserify test.coffee -t coffeeify -t workerify works. Thanks for the suggestion!

from workerify.

dstokes avatar dstokes commented on August 22, 2024

@shama nice, thx!

from workerify.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.