Beta errors on ES6 `export function foo() {}`
See original GitHub issueCalling 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:
- Created 7 years ago
- Comments:8
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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.
Thanks!