Nexe: Allow entry point with `#!`

Created on 2 Oct 2017  路  5Comments  路  Source: nexe/nexe

This is a

  • [ ] Bug Report
  • [x] Feature Request
  • [ ] Other



I'm trying to package a tiny script written for node.js v8.6.0.
It seems that Acorn is unable to parse the object rest spread operator which is supported by v8.6.0.
Is there any way to specify another parser which would be able to read the v8.6.0 code ?

Acorn error: Unexpected token (55:31)
53            return { [k]: v }
54          })
55          .reduce((acc, v) => ({ ...acc, ...v }), {})
56      }
57    }
58  }).argv59




Please also provide:

  • Platform(OS/Version): Debian Stretch
  • Host Node Version: v8.6.0
  • Target Node Version: linux-x64-8.6.0
  • Nexe version: 2.0.0-rc.11
  • Python Version: 2.7.13
bug

Most helpful comment

Parser options will likely not be exposed Since the parser could change. But allowing the entry file to have a shebang needs to be added

All 5 comments

Hmm, Okay,

In the meantime if it is a simple script (no bundling required) you can use --no-bundle or bundle: false (depending on how you're invoking nexe)

Added support for this in nexe@beta (it should just work)

I think this should be reopened, because the described error is just one case were passing parser options would be useful and sadly it doesn't just work. I'm currently struggling with creating a bundle that includes browsersync because I can't pass the allow-hash-bang option to Acorn.

So I'm currently stuck with

Acorn error: Unexpected character '#' (1:0)
File: /.../node_modules/browser-sync/index.js

Parser options will likely not be exposed Since the parser could change. But allowing the entry file to have a shebang needs to be added

as I understand, the update to ES2017 should have solverd the issue (#409)
the updated Acorn should now be able to parse spread operator, it was the reason I wanted the update.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  6Comments

ricardopolo picture ricardopolo  路  6Comments

nloomans picture nloomans  路  5Comments

nfrasser picture nfrasser  路  6Comments

transitive-bullshit picture transitive-bullshit  路  6Comments