bun icon indicating copy to clipboard operation
bun copied to clipboard

Edge case: "Can't find variable: fileName"

Open drinking-code opened this issue 3 years ago • 2 comments

Version

0.2.0

Platform

Darwin redacted.local 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:19:52 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T6000 arm64

What steps will reproduce the bug?

This is a weird one:

  • define a variable fileName
  • use the variable
const fileName = 'myValue'
console.log(fileName)

How often does it reproduce? Is there a required condition?

This will only throw if the variable name is exactly "fileName". "filename" will work, and variable names containing "fileName" + other characters also will not throw.

What is the expected behavior?

The code above does not throw.

What do you see instead?

Bildschirmfoto 2022-10-16 um 19 39 30

Additional information

No response

drinking-code avatar Oct 16 '22 17:10 drinking-code

very strange! thanks for reporting

Jarred-Sumner avatar Oct 16 '22 23:10 Jarred-Sumner

If the variable name JSX and jsx have the same issue.

xiaoxigua-1 avatar Oct 23 '22 11:10 xiaoxigua-1

This was fixed, tested as of Bun v1.0.7.

Electroid avatar Oct 25 '23 19:10 Electroid