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 in 1.14.0 with imports and unused parameters #2970

Closed
mikeharder opened this issue Jun 28, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@mikeharder
Copy link

commented Jun 28, 2019

  • Rollup Version: Regression introduced in 1.14.0, still repros in 1.16.2
  • Operating System (or Browser): Windows 10
  • Node Version: 10.16.0

Overview

If an imported function and unused parameter have the same name, rollup@1.13.1 renames the parameter which generates a valid bundle, while rollup@1.14.0 (and rollup@1.16.2) does not rename the parameter which causes a runtime error. I believe this is a regression introduced by #2892.

How Do We Reproduce?

// log.js
export const context = console.log;


// main.js
import * as log from "./log";

function test(context) {
  log.context("hello");
}

test();

Expected Behavior

REPL

> npm install --global rollup@1.13.1
> rollup main.js --format cjs
'use strict';

const context = console.log;

function test(context$1) {
  context("hello");
}

test();

Actual Behavior

REPL

> npm install --global rollup@1.14.0
> rollup main.js --format cjs
'use strict';

const context = console.log;

function test(context) {
  context("hello");
}

test();
@lukastaegert

This comment has been minimized.

Copy link
Member

commented Jun 29, 2019

Thanks for spotting this, fix at #2972

mikeharder added a commit to Azure/azure-sdk-for-js that referenced this issue Jul 8, 2019

Update dev dependency "rollup" to latest (#4079)
- "rollup" was previously pinned to 1.13.1 due to a regression in 1.14.0
  - rollup/rollup#2970
- The regression is fixed in 1.16.3
  - https://github.com/rollup/rollup/blob/master/CHANGELOG.md#1163
- Fixes #3484
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.