Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

fails transform-runtime when using async functions #97

Closed
petamoriken opened this issue Oct 31, 2016 · 3 comments
Closed

fails transform-runtime when using async functions #97

petamoriken opened this issue Oct 31, 2016 · 3 comments

Comments

@petamoriken
Copy link

input:

(async function() {
  console.log("hoge");
})();

error:

node_modules/regenerator-runtime/runtime-module.js (5:267) The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten. See https://github.com/rollup/rollup/wiki/Troubleshooting#this-is-undefined for more information
The 'typeof' Babel helper is used more than once in your code. It's strongly recommended that you use the "external-helpers" plugin or the "es2015-rollup" preset. See https://github.com/rollup/rollup-plugin-babel#configuring-babel for more information
A module cannot import itself (/Users/Moriken/Sites/runtime-test/node_modules/babel-runtime/helpers/typeof.js)
Error: A module cannot import itself (/Users/Moriken/Sites/runtime-test/node_modules/babel-runtime/helpers/typeof.js)
    at /Users/Moriken/Sites/runtime-test/node_modules/rollup/src/Bundle.js:335:14
Type rollup --help for help, or visit https://github.com/rollup/rollup/wiki

rollup.config.js

import babel from "rollup-plugin-babel";
import commonjs from "rollup-plugin-commonjs";
import nodeResolve from "rollup-plugin-node-resolve";

export default {
    entry:      "input.js",
    dest:       "output.js",
    plugins: [
        babel({
            runtimeHelpers: true
        }),
        commonjs(),
        nodeResolve()
    ]
}

.babelrc

{
	"presets":	[
		["latest", {
			"es2015": {
				"modules": false
			}
		}],
		"stage-3"
	],
	"plugins":	[
		"transform-runtime"
	]
}
modules version
rollup 0.36.3
rollup-plugin-babel 2.6.1
rollup-plugin-commonjs 5.0.5
rollup-plugin-node-resolve 2.0.0
babel-core 6.18.0
babel-preset-latest 6.16.0
babel-preset-stage-3 6.17.0
babel-plugin-transform-runtime 6.15.0
babel-runtime 6.18.0
@petamoriken
Copy link
Author

petamoriken commented Nov 5, 2016

similar content
babel/babel#3711 (comment)

@Rich-Harris
Copy link
Contributor

Hi – sorry for the slow response. Am unable to reproduce this with the latest version (v3.0.0), can you see if it's still happening, or if we can close this issue (it may have been fixed)? Thanks

@Andarist
Copy link
Member

Closing because original author has not provided a repro case that would allow finding the cause & fixing this.

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

No branches or pull requests

3 participants