vue-markdown: Cannot find module 'babel-runtime/core-js/get-iterator' in Electron build

I use your library with electron-vue. When I run DEV mod - all is well. But after building production version I get an error

Uncaught Error: Cannot find module 'babel-runtime/core-js/get-iterator'
    at Module._resolveFilename (module.js:470:15)
    at Function.Module._resolveFilename (/home/alex/LinWin/Develop/command-editor/dist/linux-unpacked/resources/electron.asar/common/reset-search-paths.js:35:12)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at webpackUniversalModuleDefinition (/home/alex/LinWin/Develop/command-editor/dist/linux-unpacked/resources/app.asar/node_modules/vue-markdown/dist/vue-markdown.common.js:9:28)
    at /home/alex/LinWin/Develop/command-editor/dist/linux-unpacked/resources/app.asar/node_modules/vue-markdown/dist/vue-markdown.common.js:16:3
    at Object.<anonymous> (/home/alex/LinWin/Develop/command-editor/dist/linux-unpacked/resources/app.asar/node_modules/vue-markdown/dist/vue-markdown.common.js:400:2)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)

Import in component:

import VueMarkdown from 'vue-markdown'

export default {
	name: 'about',
	components: { VueMarkdown },
	 // ...
}

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Reactions: 30
  • Comments: 31 (1 by maintainers)

Commits related to this issue

Most upvoted comments

I just ran into this. I did npm install --save babel-runtime and the error went away, though now I’m having other difficulties.

EDIT: Just to clarify, I’m not using Electron; I’m just doing a plain old watchify build.

Delete node_modules folder, re npm install~~

Did you install Babel runtime: npm i babel-runtime --save

Getting this issue with vue-cli.

This is an issue for me using Nuxt 2.0.

These dependencies were not found:

  • babel-runtime/core-js/get-iterator in ./node_modules/vue-markdown/dist/vue-mar kdown.common.js
  • babel-runtime/core-js/object/keys in ./node_modules/vue-markdown/dist/vue-mark down.common.js

To install them, you can run: npm install --save babel-runtime/core-js/get-itera tor babel-runtime/core-js/object/keys

Hi, had this issue today on a fresh install. Here is what I ran:

yarn add babel-runtime --save

It then compiled and worked.

Same as @leopoldkristjansson , can be bypassed until real solution by adding those dependencies to the package or going to the node_modules/vue-markdown and running install there

As mentioned above, simply installing babel-runtime may screw some things up because that is babel@6. If you are using a build tool like webpack with babel@7 simply use

import Vue from "vue";
import { install as VueMarkdown } from "vue-markdown/src/build";

Vue.use(VueMarkdown);

in your start-up file, or

<template>
    ...
</template>

<script>
import VueMarkdown from "vue-markdown/src/VueMarkdown";

export default {
    ...,
    components: {
        VueMarkdown,
        ...
    },
    ...
};
</script>

in the single-file component.

If you happen to use this import a lot and don’t want to install the plugin globally, you can also add an alias to the webpack config.

I am using yarn, this worked for me

yarn add babel-runtime --save

Same here with Nuxt 2.0.0:

These dependencies were not found: friendly-errors 11:29:00 friendly-errors 11:29:00

  • babel-runtime/core-js/get-iterator in ./node_modules/vue-markdown/dist/vue-markdown.common.js friendly-errors 11:29:00
  • babel-runtime/core-js/object/keys in ./node_modules/vue-markdown/dist/vue-markdown.common.js

Imported as follow in a plugin.

import Vue from 'vue'
import VueMarkdown from 'vue-markdown'

Vue.use(VueMarkdown)

Did you install Babel runtime: npm i babel-runtime --save

while. no work

I’m getting this same error when trying to build my Electron app. Everything works fine in dev, but it throws the error listed in production.

Any help on this?

Same here in a Nuxt 2.13+ project.

npm i babel-runtime fix it

it’s works for me too. my env is nuxt ^2.0.0.

npm i babel-runtime --save

Babel 7 has switched to scoped packages, so the rumtime is avaialble under “@babel/rumtime”, instead of ‘babel-runtime’ as in Babel v6. I think the developer would need to update the dependency. https://babeljs.io/docs/en/next/v7-migration#scoped-packages

In the mean time, explicitly installing babel v6 fixes it for me.

npm install --save babel-runtime

Same here in a Laravel Mix / Vue project.

Interesting. I’m not using Electron, I’m using babel with browserify. I ran into this error. Running npm install within the module subdirectory was enough to make to fix the problem for me.