We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
bundler renames object properties used via optional chaining and having the same names as exports
default getting started template from home page
repo: https://github.com/ivanStraltsou/parcel2-issue
parcel build ./src/index.html --no-optimize
src/index.html
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"/> <title>My First Parcel App</title> <script type="module" src="index.js"></script> </head> <body> <h1>Hello, World!</h1> </body> </html>
src/index.js
import { isAValue, isBValue } from "./lib"; console.log(isAValue({ isAValue: true })); console.log(isBValue({ isBValue: true }));
src/lib.js
// broken export const isAValue = (payload) => payload?.isAValue === true; // broken export const isAAValue = (payload) => payload?.isAValue === true; // works export const isAValue = (payload) => payload.isAValue === true; // works export const isBValue = (payload) => payload?.bValue === true;
result bundle produces valid code, object properties are not renamed
result bundle contains:
const hash$export$hash = (payload)=>payload?.hash$export$hash === true //--- // broken const $2e312cb5ec191554$export$33f07d46bc452aa4 = (payload)=>payload?.$2e312cb5ec191554$export$33f07d46bc452aa4 === true ; const $2e312cb5ec191554$export$3100cf595abe3c86 = (payload)=>payload?.bValue === true ; console.log($2e312cb5ec191554$export$33f07d46bc452aa4({ isAValue: true })); console.log($2e312cb5ec191554$export$3100cf595abe3c86({ isBValue: true })); ;
So this value is always undefined and logic is corrupted
The text was updated successfully, but these errors were encountered:
seems to be fixed in 2.6.0
Sorry, something went wrong.
duplicated by #8102, fixed in #8121
No branches or pull requests
馃悰 bug report
bundler renames object properties used via optional chaining and having the same names as exports
馃帥 Configuration (.babelrc, package.json, cli command)
default getting started template from home page
repo: https://github.com/ivanStraltsou/parcel2-issue
src/index.html
src/index.js
src/lib.js
馃 Expected Behavior
result bundle produces valid code, object properties are not renamed
馃槸 Current Behavior
result bundle contains:
So this value is always undefined and logic is corrupted
馃敠 Context
馃捇 Code Sample
repo: https://github.com/ivanStraltsou/parcel2-issue
馃實 Your Environment
The text was updated successfully, but these errors were encountered: