8000 Crash when compiling modules with ES6 exports · Issue #1731 · webpack/webpack · GitHub
[go: up one dir, main page]

Skip to content
Crash when compiling modules with ES6 exports #1731
@graue

Description

@graue

Hi there, I tried out the ES6 module support in Webpack 2.0.1-beta. Modules with ES6 export statements like:

export function foo() { }

// or
export const NUM_THINGS = 23;

// or even
let a = 1, b = 2;
export {a, b};

all seem to be crashing Webpack in HarmonyExportDependencyParserPlugin, when it does the isImmutableStatement() check. The problem seems to be that whenever an "export specifier" statement is encountered, statement.declaration is null.

After hacking the code to act as though isImmutableStatement and isHoistedStatement always returned false, I was able to get ES6 exports to work (and they work great! Nice work, thank you 😄 ), but I'm not sure what the correct fix is here. Nothing that I parse with acorn seems to produce an AST where statement.declaration is non-null in this situation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0