NON_TOP_LEVEL_STATEMENT_DEFINE error when trying to process a CommonJS module

Description

The process for converting CommonJS and AMD modules is the same except for one step. We forgot to add a module type check for this one step, meaning that AMD and CommonJS are currently processed exactly the same, which results in the following error:

ERROR: NON_TOP_LEVEL_STATEMENT_DEFINE. The define function must be called as a top-level statement. at libs/d3.js line 9501 : 50

Environment

None

Attachments

1

Activity

Show:

Maria Geller July 16, 2015 at 2:37 PM

Uploaded patch. Fixed this by checking module type before attempting to convert from AMD to CommonJS.

Completed

Details

Assignee

Reporter

Patch

Code

Fix versions

Affects versions

Priority

Created July 16, 2015 at 1:02 AM
Updated July 17, 2015 at 11:38 AM
Resolved July 17, 2015 at 11:38 AM