Parcel: Latest with --experimental-scope-hoisting still does not work

Created on 25 Jun 2018  路  3Comments  路  Source: parcel-bundler/parcel

馃悰 bug report

Pulled 1.9.3 with the fixes to tree-shaking. Didn't change any of our already working and building code from 1.9.2. Ran build with the --experimental-scope-hoisting flag. Now, it builds without error. However, going to the built package shows this JS error:

Uncaught ReferenceError: $409$var$Arr is not defined
    at Object.Dxa [as toByteArray] (client.745ce2b5.js:1)
    at N$ (client.745ce2b5.js:1)
    at i$ (client.745ce2b5.js:1)
    at zwa (client.745ce2b5.js:1)
    at $Z (client.745ce2b5.js:1)
    at g (client.745ce2b5.js:1)
    at Jg (client.745ce2b5.js:1)
    at client.745ce2b5.js:1
    at client.745ce2b5.js:1
    at client.745ce2b5.js:1

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

{
  "presets": [
    "env",
    "react",
    "stage-3"
  ],
  "env": {
    "test": {
      "plugins": [
        "rewire"
      ]
    }
  },
  "plugins": [
    [
      "module-resolver",
      {
        "root": [
          "./",
          "./components",
          "../modules",
          "../node_modules"
        ],
        "alias": {
          "style": "./style"
        }
      }
    ],
    "transform-class-properties"
  ]
}

馃 Expected Behavior

Package builds and works with --experimental-scope-hoisting.

馃槸 Current Behavior

Does not.

馃實 Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.9.3
| Node | 10.4.1
| Yarn | 1.7.0
| Operating System | macOS

Bug 馃尦 Tree Shaking

All 3 comments

Could you have a look in the bundle and look for all the references to $409$var$Arr and look for anything strange?

A minimal reproduction repo would also be helpfull.

I think I've run into the same issue. Building without --experimental-scope-hoisting works, adding the flag still builds but when using the js file I get index.js:1 Uncaught ReferenceError: Preact is not defined

Here's the code https://github.com/adriaanwm/js/tree/master/packages/app
steps:

  • npm run build open index.prod.html in browser, doesn't work
  • npm run build-working open index.prod.html in browser, works

@adriaanwm That issue was fixed by PR #2292.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Niggler picture Niggler  路  3Comments

mnn picture mnn  路  3Comments

davidnagli picture davidnagli  路  3Comments

urbanhop picture urbanhop  路  3Comments

466023746 picture 466023746  路  3Comments