Skip to content

Code broken by import-meta-ponyfill-esmodule #480

@rotu

Description

@rotu

When trying to prepare a package with dnt, I found an error like "TypeError: globalThis[Symbol.for(...)] is not a function"

It seems to have been caused by this code:

const ProxiedStruct = function (
  ...args: ConstructorParameters<typeof Struct>
) {
  return Reflect.construct(Struct, args, new.target)
}

Getting transformed to:

const ProxiedStruct = function (...args) {
    return Reflect.construct(Struct, args, globalThis[Symbol.for("import-meta-ponyfill-esmodule")](import.meta));
};

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