Skip to content

Regression: parcel@2.8.0 build keeps undefined $08c370c820b39c31$exports for ESMย #8624

@arty-name

Description

@arty-name

๐Ÿ› bug report

When I import two particular packages (one depends on another) the and run parcel build, the output file code uses an undefined identifier $08c370c820b39c31$exports. Trying to actually use the code from the file results in error then.

๐ŸŽ› Configuration (.babelrc, package.json, cli command)

Thereโ€™s no configuration beyond "type": "module" in package.json. I just run parcel build index.js.

import { TypeRegistry } from '@polkadot/types'
import { ApiPromise } from '@polkadot/api'

console.log(TypeRegistry, ApiPromise)

๐Ÿค” 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 var gs={};r(gs,"*",(()=>$08c370c820b39c31$exports)),... and $08c370c820b39c31$exports is not defined anywhere, resulting in runtime errors during more complex usage.

๐Ÿ’ Possible Solution

Stay on parcel@2.7.0 for now?

๐Ÿ”ฆ Context

I was trying to upgrade a project to use the latest parcel@2.8.0 and will not do this now.

๐Ÿ’ป Code Sample

To reproduce:

git clone https://github.com/arty-name/parcel-build-fail
cd parcel-build-fail
yarn install
yarn run build

๐ŸŒ Your Environment

Software Version(s)
Parcel 2.8.0
Node v18.12.1
Yarn 1.22.19
Operating System Ubuntu 22.10

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      โšก