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

bundler: Optional commonjs dependency (in try/catch) causes bundling to fail #1881

Open
tmpfs opened this issue Jul 2, 2021 · 0 comments
Open
Labels

Comments

@tmpfs
Copy link
Contributor

tmpfs commented Jul 2, 2021

Describe the bug

When using chokidar as a dependency the optional fsevents module causes bundling to fail on Linux as fsevents cannot be installed on Linux.

Input code

An MVP that reproduces this is here: https://github.com/tmpfs/spack-optional-dependency-mvp

Config

N/A

Expected behavior

I expect the bundler to detect the try/catch context for the require() and allow the missing dependency.

Version

The version of @swc/core: 1.2.62

Additional context

N/A

@tmpfs tmpfs added the C-bug label Jul 2, 2021
@kdy1 kdy1 modified the milestones: v1.2.63, v1.2.64 Jul 3, 2021
@kdy1 kdy1 modified the milestones: v1.2.64, v1.2.65, v1.2.66, v1.2.67 Jul 13, 2021
@kdy1 kdy1 modified the milestones: v1.2.67, v1.2.68, v1.2.72, v1.2.73, v1.2.74, v1.2.75 Jul 31, 2021
@kdy1 kdy1 modified the milestones: v1.2.75, v1.2.76, v1.2.77, v1.2.78 Aug 8, 2021
@kdy1 kdy1 modified the milestones: v1.2.78, v1.2.79, v1.2.80 Aug 15, 2021
@kdy1 kdy1 modified the milestones: v1.2.136, v1.2.137, v1.2.138, v1.2.139 Feb 3, 2022
@kdy1 kdy1 modified the milestones: v1.2.143, v1.2.144, v1.2.145, v1.2.146 Feb 19, 2022
@kdy1 kdy1 modified the milestones: v1.2.146, v1.2.147, v1.2.148, v1.2.149 Feb 27, 2022
@kdy1 kdy1 modified the milestones: v1.2.149, v1.2.150 Mar 6, 2022
@kdy1 kdy1 changed the title Optional commonjs dependency (in try/catch) causes bundling to fail bundler: Optional commonjs dependency (in try/catch) causes bundling to fail Mar 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants