Open ngryman opened 8 years ago
Hey @ngryman, thanks for editing. It makes much more sense now 😸
This plugin only parses async
/await
functions & rewrites into generator
/yield
pairings.
You'd have to require()
any external dependencies, as there's too much variability in capturing and rewriting import
statements.
If you want to post your flyfile.js
contents, I can give you a definitive answer.
@lukeed I've already tried to replace import
s with require
s without success. Then I get the following error:
stack:
- ~/Projects/noflash/flyfile.js:24
- export async function build() {
- ^^^^^^
- SyntaxError: Unexpected token export
- at Object.exports.runInThisContext (vm.js 76:16)
- at Module._compile (module.js 528:28)
- at Object.Module._extensions..js (module.js 565:10)
- at Module.load (module.js 473:32)
- at tryModuleLoad (module.js 432:12)
- at Function.Module._load (module.js 424:3)
- at Module.require (module.js 483:17)
- at require (internal/module.js 20:19)
- at new Fly (~/Projects/noflash/node_modules/fly/lib/index.js 19:43)
- at Object.<anonymous> (~/Projects/noflash/node_modules/fly/lib/cli/spawn.js 37:9)
- at next (native)
- at tryCatcher (~/Projects/noflash/node_modules/bluebird/js/release/util.js 16:23)
- at PromiseSpawn._promiseFulfilled (~/Projects/noflash/node_modules/bluebird/js/release/generators.js 97:49)
- at Promise._settlePromise (~/Projects/noflash/node_modules/bluebird/js/release/promise.js 572:26)
- at Promise._settlePromise0 (~/Projects/noflash/node_modules/bluebird/js/release/promise.js 612:10)
- at Promise._settlePromises (~/Projects/noflash/node_modules/bluebird/js/release/promise.js 691:18)
message: Unexpected token export
@ngryman Hmmm.... I just ran this flyfile
on 6.5
and 6.9.1
without any problems.
Since I don't know if there are any syntax errors within yours, do you mind running this one & tell me if it works?
Thanks!
Ok, I figured it out!
I had a syntax error (missing colon) in my flyfile.js
.
It seems that any error thrown is somehow catched by fly-esnext
and reports the misleading one I've pasted above.
Okay, then that makes sense. That's why your second trace (with the export
error) occurred on line 24.
Hi,
I get this error after a fresh install:
I'm running
fly
through anpm
run-script
.I've got the following fly packages as dependencies:
Node version is
6.5.0
.Thanks!