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.

Beta errors on ES6 `export function foo() {}`

See original GitHub issue

Calling findExports with a file containing export function foo() {} throws “TypeError: Cannot read property ‘forEach’ of undefined” on this line. The ExportNamedDeclaration’s declaration in this case is a FunctionDeclaration, which doesn’t have declarations. In this case, the export name is at node.declaration.id.name. (Here’s the relevant AST.)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
trotzigcommented, Jan 11, 2017

I can’t figure out what a ModuleDeclaration is either. For now I’m going to assume that it never shows up in an export statement.

1reaction
trotzigcommented, Jan 10, 2017

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

2.1.0-beta.22 shows an export-not-found warning for ... - GitHub
I'm submitting a bug report Webpack version: 2.1.0-beta.22 Please tell ... function cube(x) { return x * x * x; } export const...
Read more >
module.exports vs. export default in Node.js and ES6
Here we can see that the default export becomes a property on the exports object, just like foo . Import the module. We...
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 >
ES2020: `import()` – dynamically importing ES modules - 2ality
ECMAScript modules are completely static: you must specify what you import and export at compile time and can't react to changes at runtime....
Read more >
How to fix "require is not defined" in JavaScript / Node.js?
You can make use of the ES6 module import and export syntax to resolve this error. The browser does not support the Node-specific...
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