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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest with --experimental-scope-hoisting still does not work #1611

Closed
mririgoyen opened this issue Jun 25, 2018 · 3 comments
Closed

Latest with --experimental-scope-hoisting still does not work #1611

mririgoyen opened this issue Jun 25, 2018 · 3 comments

Comments

@mririgoyen
Copy link

馃悰 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
@DeMoorJasper
Copy link
Member

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.

@adriaanwm
Copy link

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

@mischnic
Copy link
Member

mischnic commented Nov 18, 2018

@adriaanwm That issue was fixed by PR #2292.

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

No branches or pull requests

6 participants