You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The import commands is overlapped by the variable in the function while the TypeScript code is valid. This causes an exception at runtime (undefined is no function).
🔦 Context
I can reproduce the bug with parcel 2.0.0-beta.1 and @parcel/transformer-typescript-tsc 2.0.0-nightly.1. However, the code worked previously so it might be due to a change in a dependency of parcel.
From a developer perspective, a workaround would be to avoid star imports and instead choose explicitly what to import (import { commands } from "vscode";). Then no latent variables are introduced during build for that.
zawys
added a commit
to zawys/vscode-as-git-mergetool
that referenced
this issue
Feb 21, 2021
🐛 Bug report
parcel build
produces invalid JS.🎛 Configuration (.babelrc, package.json, cli command)
.babelrc
: not presentpackage.json
:.parcelrc
:src/extension.ts
CLI command:
yarn run build
🤔 Expected behavior
Working code.
😯 Current behavior
Following is produced in
dist/extension.js
:The import
commands
is overlapped by the variable in the function while the TypeScript code is valid. This causes an exception at runtime (undefined is no function).🔦 Context
I can reproduce the bug with parcel 2.0.0-beta.1 and @parcel/transformer-typescript-tsc 2.0.0-nightly.1. However, the code worked previously so it might be due to a change in a dependency of parcel.
💻 Code sample
See above and parcel_bug_demo.zip (contains the files above +
yarn.lock
).🌍 Your Environment
🔗 Possibly related issues
#5746 #5657 #5091
The text was updated successfully, but these errors were encountered: