Skip to content

var syntax is tripping up Turbopack #1405

Description

@jalada

In src/browser/transport.js:

var payload = stringifyResult.value;

This line recently changed from var someOtherVariable = to var payload = .

payload is already defined in the function definition (it's spread out from the first argument). Redefining with var is technically correct but it's tripping up Turbopack because Turbopack is transforming it into this code in dev:

Transport.prototype.post = function(param) {
    let { accessToken, options, payload, headers, callback, requestFactory } = param;
    /// <...snip...>
    var payload = stringifyResult.value;

Turbopack would be happier if you removed the var which I think would be valid regardless of transformation.

I'm also going to raise this with Turbopack!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions