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
exportvarAssets;(function(Assets){functionon(channel){// ↓ Note how `service` is de-referenced to `Assets.service`returnsomeCall(Assets.service,channel);}Assets.on=on;})(Assets||(Assets={}));// Later: assign the actual `service` implementationAssets.service=getTheServiceFromSomewhere();
ESBuild output:
// ...varAssets;(function(Assets2){functionon(channel){// ↓ Note how `service` is kept as-isreturnsomeCall(service,channel);}Assets2.on=on;})(Assets||(Assets={}));Assets.service=getTheServiceFromSomewhere();
Compiled with:
esbuild --bundle test.ts --outfile=out.js
The text was updated successfully, but these errors were encountered:
Hey,
I stumbled upon a ESBuild bug with the following piece of code (simplified from a real project):
ESBuild seems to leave the
service
reference at line A as-is. This results inUncaught ReferenceError: service is not defined
.TypeScript output (playground):
ESBuild output:
Compiled with:
The text was updated successfully, but these errors were encountered: