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

Cannot find module 'babel-runtime/core-js/get-iterator' in Electron build #18

Open
cawa-93 opened this issue Feb 20, 2017 · 31 comments
Open

Comments

@cawa-93
Copy link

cawa-93 commented Feb 20, 2017

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 },
	 // ...
}
@miaolz123
Copy link
Owner

Delete node_modules folder, re npm install~~

@bradleybensmith
Copy link

@miaolz123 I am still getting this error after re-installing everything. I then did a npm install in node_modules/vue-markdown because there was no node_modules there and then got a new error:

{ [Error: ./~/vue-markdown/~/markdown-it-emoji/lib/data/full.json
Module parse failed: C:\Users\[REDACTED]\node_modules\vue-markdown\node_modules\markdown-it-emoji\lib\data\full.json Unexpected token (2:7)
You may need an appropriate loader to handle this file type.
| {
|   "100": "💯",
|   "1234": "🔢",
|   "grinning": "😀",
 @ ./~/vue-markdown/~/markdown-it-emoji/index.js 4:24-55
Windows 10

$ node -v
v6.10.0

$ npm -v
3.10.10

$ gulp -v
[07:09:41] CLI version 3.9.1
[07:09:41] Local version 3.9.1

$ npm ls webpack
C:\Users\[REDACTED]
+-- laravel-elixir-webpack-official@1.0.10
| +-- webpack@2.1.0-beta.22
| `-- webpack-stream@3.2.0 (git://github.com/jeroennoten/webpack-stream.git#d78a3568e259f9cdbc64c60290639af6ef6d3baf)
|   `-- webpack@1.14.0
`-- vue-markdown@2.1.3
  `-- webpack@1.14.0  extraneous

@Tin-Nguyen
Copy link

@bram1028 did you resolve the issue yet?

@bradleybensmith
Copy link

No. I had abandoned this. I just tried again and got the same error.

@masonfox
Copy link

masonfox commented Aug 30, 2017

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?

@jrc03c
Copy link

jrc03c commented Sep 22, 2017

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.

@stevage
Copy link

stevage commented Jul 18, 2018

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.

@leopoldkristjansson
Copy link

leopoldkristjansson commented Sep 28, 2018

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

@dexp-io
Copy link

dexp-io commented Oct 19, 2018

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

@kaixiniOSTT
Copy link

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

while. no work

@agustingabiola
Copy link

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

@tyteen4a03
Copy link

Just ran into this issue. Reinstalling dependencies is getting boring now...

@agm1984
Copy link

agm1984 commented May 9, 2019

I was still getting these problems also, so I pasted the VueMarkdown.js file from node_modules into a new file. It's only one file with a bunch of imports, so I did:

npm install --save-dev markdown-it markdown-it-emoji markdown-it-sub markdown-it-sup markdown-it-footnote markdown-it-deflist markdown-it-abbr markdown-it-ins markdown-it-mark markdown-it-toc-and-anchor markdown-it-katex markdown-it-task-lists

It worked, as in it rendered unparsed markdown, which was better than those babel runtime errors.

I'm having other issues now related to styling the markdown output. I already abandoned this library because of that but I'm having the same issue with the markdown editor example from the Vue docs, and an article that shows how to make a markdown preview component, AND with vue-tiptap.

There seems to be an issue with v-html and styling CSS that is way out of the scope of this GitHub issue.

Long story short, I think I fixed the problem described in here with my described steps, but I'm not sure so I'll just leave this comment about it.

Also I recommend caution with just blindly installing babel-runtime especially if you are using Babel 7. You might be massively inflating your bundle size. I saw mine go up 70kb at one point.

@fjeddy
Copy link

fjeddy commented Jun 17, 2019

Getting this issue with vue-cli.

@filippolcr
Copy link

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)

@MichMich
Copy link

Same here in a Laravel Mix / Vue project.

@dargmuesli
Copy link

#92 proposes a fork where this issue is fixed.

@ZeanQin
Copy link

ZeanQin commented Nov 29, 2019

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

@fguillen
Copy link

I am using yarn, this worked for me

yarn add babel-runtime --save

@che5ya
Copy link

che5ya commented Dec 18, 2019

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

npm i babel-runtime --save

@coolsoftwaretyler
Copy link

Also ran into this problem, followed the README instructions in a blank vue-cli project.

@bsansone
Copy link

I experienced this issue today on our build server, things had been working fine for a few weeks and out of the blue this error started appearing. npm i babel-runtime --save fixed things but not sure why this wasn't needed originally.

@clouedoc
Copy link

clouedoc commented Mar 7, 2020

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

yarn add babel-runtime --save

It then compiled and worked.

@ballonura
Copy link

Same here in a Nuxt 2.13+ project.

npm i babel-runtime fix it

@pixelart7
Copy link

pixelart7 commented Jul 31, 2020

Got similar issue as well and yarn add babel-runtime does the magic!

I spent quite some time to find the problem, and I just want to put it here so if people search they can find this too:

I deployed a Nuxt app with vue-markdown on Google App Engine and got error randomly in some pages that use vue-markdown:

ERROR render function or template not defined in component: anonymous
at Qi (node_modules/vue-server-renderer/build.prod.js:1:66749)
at io (node_modules/vue-server-renderer/build.prod.js:1:70622)
at ro (node_modules/vue-server-renderer/build.prod.js:1:70272)
at eo (node_modules/vue-server-renderer/build.prod.js:1:67519)
at node_modules/vue-server-renderer/build.prod.js:1:70739

When setting NODE_ENV to "development", it throws similar error of this post.

ERROR Cannot find module 'babel-runtime/core-js/get-iterator'

Note: The error does not shown in local development (nuxt build and then nuxt start).

The solution is as stated by many above. babel-runtime fixes the problem!

kinow added a commit to kinow/cylc-ui that referenced this issue Aug 19, 2020
kinow added a commit to kinow/cylc-ui that referenced this issue Aug 19, 2020
kinow added a commit to kinow/cylc-ui that referenced this issue Aug 20, 2020
@slc3a2
Copy link

slc3a2 commented Sep 8, 2020

use npm i babel-runtime --save to resolve this error, it worked

macOS 10.14
vue@2.6.11
vue-markdown@2.2.4
node@10.13.0

@schl3ck
Copy link

schl3ck commented Sep 10, 2020

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.

@mcasto
Copy link

mcasto commented Sep 28, 2020

I had this problem today. I went directly into node_modules/vue-markdown and ran npm install there, and it resolved the issue but with a ton of warnings, including

core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.

so I upgraded core-js in that folder, and got the error again.

It looks like get-iterator is no longer part of core-js or that functionality has been renamed. I'll try the solution mentioned @schl3ck next.

That worked like a charm.

@OssiPesonen
Copy link

This is still an issue. Recently installed Nuxt.js version 2.14.6, and then installed vue-markdown to render markdown content for a website. Had to run yarn add babel-runtime to make this issue disappear.

@Lowell130
Copy link

Lowell130 commented Dec 27, 2020

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

thanks work for me, on Gridsome and Strapi

@kinow kinow mentioned this issue Jun 1, 2021
6 tasks
@quiquelhappy
Copy link

still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests