Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Syntax error with template string in npm module #120

Open
godjirax opened this issue Jan 15, 2016 · 1 comment
Open

Syntax error with template string in npm module #120

godjirax opened this issue Jan 15, 2016 · 1 comment

Comments

@godjirax
Copy link

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.

@j-holub
Copy link

j-holub commented Jun 21, 2016

I can confirm that bug. I wrote a npm module which I actually wanted to use with meteor. But template Strings break it.

Node itself can run it, and if I use template Strings in meteor directly they work fine as well. But importing an npm module with template string breaks the compatibility.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants