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

[core] regeneratorRuntime is not defined #1182

Closed
jackovsky8 opened this issue Nov 20, 2017 · 24 comments
Closed

[core] regeneratorRuntime is not defined #1182

jackovsky8 opened this issue Nov 20, 2017 · 24 comments
Assignees

Comments

@jackovsky8
Copy link

I poorly just don't get this to run.

Steps to reproduce

As soon as I import -
import { MdApp } from 'vue-material/dist/components'
import 'vue-material/dist/vue-material.min.css'
Vue.use(MdApp)

to my project, I get:

index.js:1 Uncaught ReferenceError: regeneratorRuntime is not defined at index.js:1 at Object../node_modules/vue-material/dist/components/index.js.Object.defineProperty.value (index.js:1)

I am working with JeffreyWay/laravel-mix
let mix = require('laravel-mix'); mix.js('resources/assets/spa/main.js','public/js/app')

Happens also if i try to import the whole bundle or other components.

@flyinghawker
Copy link

same issue here, just try to set up vue-material in my plain new project but this annoy me, no way to figure out.

@Samuell1
Copy link
Member

Looks like its because you doesnt have await/async: https://stackoverflow.com/a/33527883

@jackovsky8
Copy link
Author

@Samuell1 - Thanks! This actually was the solution...

That is now my package.json:
"devDependencies": {
"axios": "^0.17",
"babel-core": "^6.0.20",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-polyfill": "^6.0.16",
"babel-preset-env": "^1.6.1",
"babel-preset-stage-3": "^6.24.1",
"bootstrap-sass": "^3.3.7",
"cross-env": "^5.1",
"jquery": "^3.2",
"laravel-mix": "^1.0",
"lodash": "^4.17.4",
"vue": "^2.1.10"
},
"dependencies": {
"babel-runtime": "^6.26.0"
}

my .babelrc:
"presets": [ "env", "stage-3" ],
"plugins": [
["transform-runtime", {
"polyfill": false,
"regenerator": true
}]
]

and on the top of my index.js i added:
import "babel-core/register"
import 'babel-polyfill'

@marcosmoura
Copy link
Member

This is quite strange. I will take a deep look. The babel stuff should be built in Vue Material.

@marsvin
Copy link

marsvin commented Dec 8, 2017

Maybe the transform-async-to-generator transform could be an alternative to using babel-polyfill:
https://babeljs.io/docs/plugins/transform-async-to-generator/
It requires much less code. babel-polyfill adds around 60kB to your project.

@Samuell1
Copy link
Member

Samuell1 commented Dec 8, 2017

yes, but babel-polyfill adds support for all things not only 1 @marsvin

@Samuell1 Samuell1 changed the title regeneratorRuntime is not defined [core] missing IE polyfills Dec 11, 2017
@Samuell1 Samuell1 changed the title [core] missing IE polyfills [core] regeneratorRuntime is not defined Dec 13, 2017
@andtii
Copy link

andtii commented Dec 14, 2017

Whats the status of this issue? Shouldnt Vue Material work without external polyfills? or else the getting started has to be updated?

@andtii
Copy link

andtii commented Dec 14, 2017

Got this error on md-input

image

@Huupke
Copy link

Huupke commented Dec 25, 2017

I get the same error in my typescript+webpack project when importing individual components:

ReferenceError: Can't find variable: regeneratorRuntime

import { MdLayout, MdCard} from 'vue-material/dist/components';
import 'vue-material/dist/vue-material.min.css';
Vue.use(MdLayout);
Vue.use(MdCard);

But not when importing the whole module:

import VueMaterial from 'vue-material';
import 'vue-material/dist/vue-material.min.css';
Vue.use(VueMaterial);

and using the exact same template with just some simple layout components.

@guillenotfound
Copy link

Same issue here:

const components = {
    "md-snackbar": require('vue-material/dist/components/MdSnackbar')
};

Any chance to get the PR merged soon?
Thanks.

@RichardJECooke
Copy link

Hi, I'm new to Vue, just tried to follow the 'getting started' documentation and got this error. Which I see is closed. How do you fix it please?

@Samuell1
Copy link
Member

Samuell1 commented Jan 4, 2018

@RichardJECooke After PR will be merged it should work like is written in docs, now you need to use

import VueMaterial from 'vue-material';
import 'vue-material/dist/vue-material.min.css';
Vue.use(VueMaterial);

@FrancescoMussi
Copy link

Just installed and I got the same exact situation as @Huupke.

@Samuell1 Would be possible to import individual components?

@guillenotfound
Copy link

That would be awesome @FrancescoMussi ; import a whole css file when you only use some components doesn't make too much sense...

@doccom-applibs
Copy link

Agreed @FrancescoMussi @ZiFFeL1992 , that would be incredibly useful, especially for older projects migrating to vuematerial.

@ricardopolo
Copy link

In my case I need to import full VueMaterial. Importing single componetns generates this error

@Samuell1
Copy link
Member

Samuell1 commented Feb 5, 2018

This issue should be fixed in dev branch.

@michjk
Copy link

michjk commented Feb 16, 2018

@Samuell1 is it available already as npm package?

@Samuell1
Copy link
Member

No, its only in dev branch @michjk

@highco
Copy link

highco commented Apr 21, 2018

@Samuell1 Any update on this? When will it be released?

@asmi77
Copy link

asmi77 commented Apr 21, 2018

The same for me, importing components throws a "regeneratorRuntime is not defined" error, but importing full VueMaterial is ok.

@jordigoyanes
Copy link

I'm having the same issue as @asmi77
It's april 21 already and no solution has been applied?

@Samuell1
Copy link
Member

@jordigoyanes @highco issue is solved in DEV branch like i said in comments before, we waiting to release new version from @marcosmoura that will fix this issue.

@Samuell1
Copy link
Member

New release is out and this should be fixed with it! If you anything find feel free to ping me here :)

https://github.com/vuematerial/vue-material/releases/tag/v1.0.0-beta-10

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

No branches or pull requests