Parcel: Similar Files are collapsed (breaking react-bootstrap)

Created on 16 Sep 2019  路  4Comments  路  Source: parcel-bundler/parcel

馃悰 bug report

When two different modules contain the same code, they are collapsed such that the code does not get executed as required.

For example, react-bootstrap contains two files with this content:

import React from 'react';
export default React.createContext(null);

With parcel, these "two modules" actually execute only once and return the same value. If I add some comment to one (e.g. //) it works as expected.

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

Running parcel with:

parcel --no-cache ./src/index.html --public-url=/reacttest --no-hmr

馃 Expected Behavior

Perhaps the code could be collapsed for space saving purposes, but it still needs to be executed individually.

馃槸 Current Behavior

Similar files are merged and eliminated and executed only once.

馃拋 Possible Solution

Ideally do not eliminate similar files, or ensure they are executed individually.

馃敠 Context

This breaks basic behavior in react-bootstrap related to CardContext and AccordionContext.

Bug Confirmed Bug

Most helpful comment

Agreed that this is worth fixing on 1.x. This issue has cost me several days in troubleshooting.

All 4 comments

A duplicate of #3368.

I think it's severe enough to deserve a fix on 1.x branch.

(The relevant function:
https://github.com/parcel-bundler/parcel/blob/fe08980a6f256d94100d017e7c1f1e0b3a527ec0/packages/core/parcel-bundler/src/Asset.js#L227-L229
this.name or this.relativeName could also be factored in
)

Agreed that this is worth fixing on 1.x. This issue has cost me several days in troubleshooting.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jssee picture jssee  路  46Comments

Znarkus picture Znarkus  路  38Comments

devongovett picture devongovett  路  49Comments

WayneHiller picture WayneHiller  路  51Comments

mcfarljw picture mcfarljw  路  46Comments