Skip to content

scope hoisting: Cannot read property 'constantViolations' of undefined #2255

@rambo-panda

Description

@rambo-panda

🐛 bug report

https://github.com/parcel-bundler/parcel/blob/v1.10.3/src/scope-hoisting/renamer.js#L6 will be throw an error Cannot read property 'constantViolations' of undefined when l use
npx -n '--inspect-brk' parcel build --no-minify --experimental-scope-hoisting --no-source-maps --no-cache --log-level 4 main.js

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

{
  "name": "tmp",
  "version": "1.0.0",
  "description": "",
  "dependencies": {
    "@babel/cli": "^7.1.2",
    "@babel/core": "^7.1.2",
    "@babel/plugin-transform-runtime": "^7.1.0",
    "@babel/runtime": "^7.1.2",
    "lodash.once": "^4.1.1",
    "parcel-bundler": "^1.10.3"
  },
  "license": "ISC"
}

// .babelrc
{
  "plugins": [
    [
      "@babel/plugin-transform-runtime",
      {
        "corejs": false,
        "helpers": false,
        "regenerator": true
      }
    ]
  ]
}

😯 Current Behavior

blocking

💻 Code Sample

main.js

const v  = async () => {
	const x = await new Promise((resolve) => {
		resolve(1)
	});

	return x;
};

v().then(r=>{
	console.log(r);
});

🌍 Your Environment

Software Version(s)
Parcel 1.10.3
Node 10.13
npm/Yarn 6.4.1
Operating System mac

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions