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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: [email protected] build keeps undefined $7f9d4f94f3d938e3$re_export$bool for ESM #8705

Closed
arty-name opened this issue Dec 19, 2022 · 1 comment · Fixed by #8738

Comments

@arty-name
Copy link
Contributor

🐛 bug report

When I build my project using parcel build the output file includes an undefined identifier $7f9d4f94f3d938e3$re_export$bool. Trying to actually use it results in error.

This error only started appearing after #8624 was fixed.

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

The parcel configuration of the project is pretty basic

  "targets": {
    "default": {
      "source": "src/index.html",
      "distDir": "build",
      "context": "browser"
    }
  },

🤔 Expected Behavior

When optimizing the code parcel should not remove declarations of constants that are used in the code.

😯 Current Behavior

The code includes the line e(aA,"bool",(()=>$7f9d4f94f3d938e3$re_export$bool)),.. and $7f9d4f94f3d938e3$re_export$bool is not defined anywhere, resulting in runtime errors.

💁 Possible Solution

Stay on [email protected] for now?

🔦 Context

I was trying to upgrade a project to use the [email protected] and will not do this now.

💻 Code Sample

The parcel update PR in my project and it’s deployed version.

🌍 Your Environment

Software Version(s)
Parcel 2.8.1
Node v18.12.1
npm/Yarn 1.22.19
Operating System Ubuntu 22.04.1
@mischnic
Copy link
Member

mischnic commented Jan 1, 2023

MInimal Reproduction:

import * as ns from "./library/b";
console.log(ns, ns.value1, ns.value2);

// library/package.json 
{ "sideEffects": false }

// library/b.js
export { value1, value2 } from './c.js';

// library/c.js
export { value1, value1 as value2 } from "./d";

// library/d.js
export const value1 = 2;

A regression caused by #8432

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