Skip to content

Syntax error with template string in npm module #120

@godjirax

Description

@godjirax

I have problem with npm producthunt module that i try to add in my meteor project with meteorhacks.

I can reproduce the problem with the example :

meteor create simple-todos
meteor add meteorhacks:npm
cd simple-todos

I create the file packages.json at the root of the project, with :

{
    "producthunt":"0.2.0"
}

If i launch project with any modification, it works.

If i import the npm module in simple-todos.js (Meteor.npmRequire('producthunt')), i obtain the error:

W20160115-09:16:08.729(1)? (STDERR) simple-todos/.meteor/local/isopacks/npm-container/npm/node_modules/producthunt/index.js:25
W20160115-09:16:08.729(1)? (STDERR)   this.posts = require(`./api/v${this.version}/posts`)(this)

The error occurs with the use of template string.

But, if a try to use it in simple-todos.js, it works well :

var obj = {
    prop : 'test'
  };
console.log(`./api/${obj.prop}/posts`);

  // --> ./api/test/posts

It seems that the project can execute ecmascript6 script, but not npm imported module.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions