Skip to content
This repository was archived by the owner on Aug 4, 2021. It is now read-only.
This repository was archived by the owner on Aug 4, 2021. It is now read-only.

Fail to import deconstructed object variable with Literals declaration #303

@edoardocavazza

Description

@edoardocavazza

The plugin fails bundling a module which exports a variable from deconstruction with literal keys.

[!] (commonjs plugin) TypeError: extractors[prop.key.type] is not a function

Example
module.js

const obj = {
    index: 0,
    1: 1,
    2: 2,
    3: 3,
};

let {
    index: a,
    1: b,
    2: c,
    3: d
} = obj;

module.exports = b;

index.js

import b from './module.js';

It seems a rollup-pluginutils failure (here the related issue and PR). Also, the extractNames helper in rollup-plugin-commonjs could have the same issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions