Parcel: --experimental-scope-hoisting breaks project using rebass

Created on 5 May 2019  路  3Comments  路  Source: parcel-bundler/parcel

Choose one: a 馃悰 bug report

馃帥 Configuration (.babelrc, package.json, cli command)

Please see https://gist.github.com/midnightcodr/fbcfc63ab80951b3f13b330b0ec1f406

{
  "presets": [
    "env",
    "react"
  ],
  "plugins": [
    "transform-object-rest-spread",
    "transform-class-properties"
  ]
}

馃 Expected Behavior


If I build the project without --experimental-scope-hoisting, everything works as expected. But with the option on, when serving the site, I am getting

screenshot

In the browser console and a blank page.

馃槸 Current Behavior


It should render a page with "Hello React!" and no js error.

馃拋 Possible Solution

馃敠 Context

馃捇 Code Sample


Please see https://gist.github.com/midnightcodr/fbcfc63ab80951b3f13b330b0ec1f406

馃實 Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| Parcel |1.12.3
| Node |10.15.3
| npm/Yarn |6.4.1
| Operating System |Ubuntu 19.04

Bug 馃尦 Tree Shaking

Most helpful comment

How can I start using the version with your fix @devongovett ?

All 3 comments

This is due to a missing __esModule flag that babel uses for interop between common JS and ES6 modules. I made a commit to the Parcel 2 tree shaking branch that fixes this: https://github.com/parcel-bundler/parcel/pull/2967/commits/ab98afe2ba3dcf2a8978580cd119ded770212fc5. Will need to be back ported.

Should be fixed by #2993.

How can I start using the version with your fix @devongovett ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidnagli picture davidnagli  路  3Comments

dotdash picture dotdash  路  3Comments

philipodev picture philipodev  路  3Comments

algebraic-brain picture algebraic-brain  路  3Comments

466023746 picture 466023746  路  3Comments