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

undefined is not an object (evaluating '_regeneratorRuntime.mark') #10185

Open
birolkoklu opened this issue Jul 9, 2019 · 3 comments

Comments

Projects
None yet
3 participants
@birolkoklu
Copy link

commented Jul 9, 2019

Bug Report

Current Behavior
I'm developing a vuejs project with Babel and rollup. But I get such an error in the console.

Input Code

  • REPL or Repo link if applicable:

Gulp Configuration

import "regenerator-runtime/runtime";
import config from "../../config";

import { src, dest, series } from "gulp";

const rollup = require("gulp-better-rollup"),
	rollupbabel = require("rollup-plugin-babel"),
	resolve = require("rollup-plugin-node-resolve"),
	commonjs = require("rollup-plugin-commonjs"),
	replace = require("rollup-plugin-replace"),
	json = require("rollup-plugin-json"),
	param = require("yargs").alias("prod", "production").argv,
	gulpif = require("gulp-if"),
	uglify = require("gulp-uglify"),
	babel = require("gulp-babel"),
	sourcemaps = require("gulp-sourcemaps");

function js() {
  return src(config.script.src)
		.pipe(sourcemaps.init(config.sourcemaps.src))
		.pipe(
				rollup({
					plugins: [
						resolve({
							jsnext: true,
							main: true,
							browser: true,
						}),
						rollupbabel({
							runtimeHelpers: true
							exclude: "node_modules/**",
						}),
						commonjs(),
						replace({
							"process.env.NODE_ENV": JSON.stringify("production")
						}),
						json()
					]
				}, "umd")
		)
		.pipe(gulpif(param.production, babel({
			presets: ["@babel/preset-env"]
		})))
		.pipe(gulpif(param.production, uglify(config.script.uglify)))
		.pipe(sourcemaps.write("./maps", config.sourcemaps.dist))
		.pipe(dest(config.script.dist));
}

export {
	js
};

exports.script = series(js);

Expected behavior/code
How can I solve this problem?

Babel Configuration (.babelrc, package.json, cli command)

babel.config.js

module.exports = function (api) {
	api.cache(true);

	const presets = [
    [
      "@babel/preset-env", {
        "targets": {
          "browsers": ["last 2 versions"]
				},
				"useBuiltIns": "entry"
      }
    ]
  ];
	const plugins = [
		"@babel/plugin-proposal-class-properties",
		"@babel/plugin-proposal-export-default-from",
		"@babel/plugin-transform-regenerator",
		[
			"@babel/plugin-transform-runtime",
			{
				"regenerator": true
			}
		],
		["@babel/plugin-proposal-object-rest-spread", {
			loose: true
		}]
	];

	return {
		presets,
		plugins
	};
}

package.json

{
..........
	"devDependencies": {
		"@babel/cli": "^7.4.4",
		"@babel/core": "^7.4.5",
		"@babel/plugin-proposal-class-properties": "^7.5.0",
		"@babel/plugin-proposal-export-default-from": "^7.5.2",
		"@babel/plugin-proposal-object-rest-spread": "^7.5.2",
		"@babel/plugin-transform-regenerator": "^7.4.5",
		"@babel/plugin-transform-runtime": "^7.5.0",
		"@babel/polyfill": "^7.4.4",
		"@babel/preset-env": "^7.4.5",
		"@babel/register": "^7.4.4",
		"autoprefixer": "^9.6.0",
		"babel-core": "^7.0.0-bridge.0",
		"browser-sync": "^2.26.7",
		"critical": "^1.3.4",
		"css-mqpacker": "^7.0.0",
		"cssnano": "^4.1.10",
		"del": "^4.1.1",
		"gulp": "^4.0.2",
		"gulp-babel": "^8.0.0",
		"gulp-cache": "^1.1.2",
		"gulp-concat": "^2.6.1",
		"gulp-count": "^1.0.0",
		"gulp-hash-filename": "^2.0.1",
		"gulp-if": "^2.0.2",
		"gulp-image": "^5.1.0",
		"gulp-imagemin": "^5.0.3",
		"gulp-inject": "^5.0.2",
		"gulp-postcss": "^8.0.0",
		"gulp-replace": "^1.0.0",
		"gulp-sass": "^4.0.2",
		"gulp-uglify": "^3.0.2",
		"postcss-reporter": "^6.0.1",
		"puppeteer": "^1.18.0",
		"require-dir": "^1.2.0",
		"rollup-plugin-replace": "^2.2.0",
		"stylelint": "^9.10.1",
		"yargs": "^13.2.4"
	},
	"dependencies": {
		"@babel/runtime": "^7.5.2",
		"axios": "^0.19.0",
		"gulp-better-rollup": "^4.0.1",
		"gulp-sourcemaps": "^2.6.5",
		"node-sass": "^4.12.0",
		"rollup": "^1.16.2",
		"rollup-plugin-babel": "^4.3.3",
		"rollup-plugin-commonjs": "^10.0.0",
		"rollup-plugin-json": "^4.0.0",
		"rollup-plugin-node-resolve": "^5.0.4",
		"vue": "^2.6.10"
	},
	"resolutions": {
		"@babel/plugin-proposal-object-rest-spread": "7.5.2"
	},
	"optionalDependencies": {}
}

Environment

  • Babel version(s): "@babel/core": "^7.4.5"
  • Node/npm version: Node v10.15.3/npm 6.4.1
  • OS: IOS, v9
  • Monorepo: no

Additional context/Screenshots
Screen Shot 2019-07-09 at 15 59 28

@babel-bot

This comment has been minimized.

Copy link
Collaborator

commented Jul 9, 2019

Hey @birolkoklu! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community
that typically always has someone willing to help. You can sign-up here
for an invite.

@birolkoklu

This comment has been minimized.

Copy link
Author

commented Jul 9, 2019

Hi,

I can't subscribe to the link you provided. (https://babeljs.slack.com/) Only login :s

@stof

This comment has been minimized.

Copy link

commented Jul 10, 2019

@birolkoklu see the second link about requesting an invite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.