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

v1.0.0 throws "z is not a function" #146

Closed
yhatt opened this issue Jan 17, 2020 · 1 comment · Fixed by #147
Closed

v1.0.0 throws "z is not a function" #146

yhatt opened this issue Jan 17, 2020 · 1 comment · Fixed by #147
Labels
bug Something isn't working

Comments

@yhatt
Copy link
Member

yhatt commented Jan 17, 2020

Marp Core v1.0.0 throws TypeError: z is not a function just by calling require('@marp-team/marp-core').

> require('@marp-team/marp-core')
Thrown:
TypeError: z is not a function
    at Object.<anonymous> (/Users/yhatt/Programs/marp-team/marp-cli/node_modules/@marp-team/marp-core/lib/marp.js:1:941)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function.Module._load (internal/modules/cjs/loader.js:723:14)
    at Module.require (internal/modules/cjs/loader.js:848:19)
    at require (internal/modules/cjs/helpers.js:74:18)

The same issue has reported in marp-team/marp-cli#198 and marp-team/marp-react#19.

@yhatt yhatt added the bug Something isn't working label Jan 17, 2020
@yhatt
Copy link
Member Author

yhatt commented Jan 17, 2020

Unpacked source

var plugin = createCommonjsModule(function (module, exports) {

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

/** @module */

/**
 * Create Marpit plugin.
 *
 * Generate Marpit plugin from passed markdown-it plugin. Marpit plugin needs
 * markdown-it instance with `marpit` member.
 *
 * @alias module:plugin
 * @param {Function} plugin Base plugin for markdown-it.
 * @returns {Function} Generated Marpit plugin.
 */
function marpitPlugin(plugin) {
  // eslint-disable-next-line func-names
  return function (md, ...args) {
    if (md.marpit) return plugin.call(this, md, ...args);
    throw new Error('Marpit plugin has detected incompatible markdown-it instance.');
  };
}

var _default = marpitPlugin;
exports.default = _default;
});

unwrapExports(plugin);

var plugin$1 = plugin;
Thrown:
TypeError: plugin$1 is not a function
    at Object.<anonymous> (/Users/yhatt/Programs/marp-team/marp-core/lib/marp.js:70:18)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function.Module._load (internal/modules/cjs/loader.js:723:14)
    at Module.require (internal/modules/cjs/loader.js:848:19)
    at require (internal/modules/cjs/helpers.js:74:18)

I'm sure it has related to rollup/plugins#102.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant