Skip to content

webpack (6to5) require/import problem  #86

@max-mykhailenko

Description

@max-mykhailenko

I tried to use autolinker from npm module

And after import
import Autolinker from 'autolinker';

get this
Uncaught TypeError: Cannot set property 'returnExportsGlobal' of undefined

In code

(function (root, factory) {
    if (true) {
        // AMD. Register as an anonymous module.
        !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {
            return root.returnExportsGlobal = factory();
        }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
    } else if (typeof exports === "object") {
        // Node. Does not work with strict CommonJS, but
        // only CommonJS-like enviroments that support module.exports,
        // like Node.
        module.exports = factory();
    } else {
        root.Autolinker = factory();
    }
})(undefined, function () {                // why this undefined?
... // autolinker here

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions