jspm / project

Roadmap and management repo for the jspm project
161 stars 8 forks source link

CDN build error for https://ga.jspm.io/npm:complex.js@2.1.1/ #241

Closed nvh closed 1 year ago

nvh commented 1 year ago

Reporting CDN Build Error.

guybedford commented 1 year ago

Thanks for posting, I can confirm this is triggering a stack overflow in the build process, and have a test case for it. Will hopefully be able to get a fix out on the weekend.

Bubblyworld commented 1 year ago

The issue seems to be here in complex.js. For some reason when the DEW plugin handles the ReferencedIdentifier "Object" the scope's parent is equal to the scope itself, which causes an infinite loop. Struggling to reproduce on AST explorer, where the same referenced identifier has a well-behaved scope 🤔

Bubblyworld commented 1 year ago
Screenshot 2023-03-30 at 17 00 12

^ for example, this is triggered by complex.js

Bubblyworld commented 1 year ago

Reproduction of the bug is running the plugin on:

(function(root) {
  function Complex() {}

  if (typeof define === 'function' && define['amd']) {
    define([], function() {
      return Complex;
    });
  } else if (typeof exports === 'object') {
    Object.defineProperty(Complex, "__esModule", { 'value': true });
    Complex['default'] = Complex;
    Complex['Complex'] = Complex;
    module['exports'] = Complex;
  } else {
    root['Complex'] = Complex;
  }
})(this);
Bubblyworld commented 1 year ago

(closing as this was resolved on the builder)

guybedford commented 1 year ago

Reopening pending the builder update.

guybedford commented 1 year ago

This is finally working at https://generator.jspm.io/#U2RhYGBkDM0rySzJSU1hSM7PLchJrdDLKnYw0jPUMwQA/m2L2R8A.