Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression for ESM imported classes #4184

Closed
shanewholloway opened this issue Jul 22, 2021 · 4 comments · Fixed by #4189
Closed

Regression for ESM imported classes #4184

shanewholloway opened this issue Jul 22, 2021 · 4 comments · Fixed by #4189

Comments

@shanewholloway
Copy link

Rollup Version

^2.49.0

Operating System (or Browser)

Linux (Ubuntu 21-04)

Node Version (if applicable)

v12; v16

Link To Reproduction

https://replit.com/@shanewholloway/rollup-regression-v2490-swh-class-use#readme.md

Expected Behaviour

I expect rollup -c to produce an compiled output or emit an error with help to resolve any issues. This works as expected with rollup version v2.48.0.

Actual Behaviour

rollup -c fails with version v2.49 and after; no helpful error message to resolve issues.

  • rollup v2.49.0 to v2.52.7 errors with RangeError: Maximum call stack size exceeded
  • rollup v2.52.8 to v2.53.3 runs out of memory and core dumps on Linux.
@kzc
Copy link
Contributor

kzc commented Jul 23, 2021

Appears to be an infinite loop of calls to deoptimizeThisOnEventAtPath.

repro:

$ cat c.js
class Foo {
    static echo(message) {
        this.prototype.echo(message);
    }
    echo(message) {
        console.log(message);
    }
}

class Bar extends Foo {
}

global.baz = "PASS";
Bar.echo(baz);

expected:

$ cat c.js | node
PASS

actual:

$ rollup c.js --silent
...
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

@lukastaegert
Copy link
Member

Thanks a lot for the repro and refinement! I was able to write a small fix but it will need to wait until tomorrow to be refined and rolled out unfortunately.

@lukastaegert
Copy link
Member

Fix at #4189

@shanewholloway
Copy link
Author

v2.54.0 works great -- thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants