question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

rulesToQuery uses ES6 export

See original GitHub issue

I get this error (I am trying to use rulesToQuery for sequelize etc.):

/home/myuser/myproject/node_modules/@casl/ability/extra.js:134
export { rulesToQuery, permittedFieldsOf, packRules, unpackRules };
^^^^^^

SyntaxError: Unexpected token export

Can I somehow have a ES5 version of rulesToQuery as so far I did not compile with Babel and prefer things to stay that way (most recent node 10.5.0 still does not support export).

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
musicformellonscommented, Jul 2, 2018

Yeah, with version 2.4.1 it is good now!

1reaction
stalniycommented, Jul 2, 2018

Meanwhile the workaround is this:

require('@casl/ability/extra/') // <-- add slash at the end ;)
Read more comments on GitHub >

github_iconTop Results From Across the Web

ES6 Modules and How to Use Import and Export in JavaScript
The ES2015 (ES6) edition of the JavaScript standard gives us native support for modules with the import and export syntax.
Read more >
Using Node.js require vs. ES6 import/export - Stack Overflow
Importing modules using ES6 import , and exporting using ES6 export. Are there any performance benefits to using one over the other? Is...
Read more >
export - JavaScript - MDN Web Docs
The export declaration is used to export values from a JavaScript module. Exported values can then be imported into other programs with the ......
Read more >
16. Modules - Exploring JS
An ES6 module can pick a default export, the main exported value. Default exports are especially easy to import. The following ECMAScript 6...
Read more >
JavaScript ES6/CommonJS syntax - AWS SDK for JavaScript
ES6 requires you use Node.js version 13.x or higher. ... Convert all ES6 export statements to CommonJS module.exports statements. For example, convert:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found