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

Spurious "Symbol" detected with --featureCheck against es5 #234

Open
Aarononomous opened this issue Jan 15, 2025 · 3 comments
Open

Spurious "Symbol" detected with --featureCheck against es5 #234

Aarononomous opened this issue Jan 15, 2025 · 3 comments

Comments

@Aarononomous
Copy link

Requested Update

Thanks for the great tool!

I get an error that I've used a Symbol in es5 when I haven't.

Here's a very small reproduction:

$ echo 'window.getElementById("x");' > $TMPDIR/test.js; npx es-check@latest es5 $TMPDIR/test.js --checkFeatures --verbose
Need to install the following packages:
[email protected]
Ok to proceed? (y) y

debug: ES-Check: Going to check files using version 5
debug: ES-Check: checking /var/folders/t3/kryjc_nj35l5h2lvvl0dflb00000gq/T/test.js
~/.npm/_npx/29ab2ebeba26f336/node_modules/es-check/detectFeatures.js:71
    throw new Error(
    ^

Error: Unsupported features detected: Symbol. These require a higher ES version than 5.
    at detectFeatures (~/.npm/_npx/29ab2ebeba26f336/node_modules/es-check/detectFeatures.js:71:11)
    at ~/.npm/_npx/29ab2ebeba26f336/node_modules/es-check/index.js:222:54
    at Array.forEach (<anonymous>)
    at Command.<anonymous> (~/.npm/_npx/29ab2ebeba26f336/node_modules/es-check/index.js:203:19)
    at Command.listener [as _actionHandler] (~/.npm/_npx/29ab2ebeba26f336/node_modules/commander/lib/command.js:542:17)
    at ~/.npm/_npx/29ab2ebeba26f336/node_modules/commander/lib/command.js:1502:14
    at Command._chainOrCall (~/.npm/_npx/29ab2ebeba26f336/node_modules/commander/lib/command.js:1386:12)
    at Command._parseCommand (~/.npm/_npx/29ab2ebeba26f336/node_modules/commander/lib/command.js:1501:27)
    at Command.parse (~/.npm/_npx/29ab2ebeba26f336/node_modules/commander/lib/command.js:1064:10)
    at Object.<anonymous> (~/.npm/_npx/29ab2ebeba26f336/node_modules/es-check/index.js:256:9)

Node.js v22.11.0

window.getElementById is clearly not a Symbol!

Are There Examples Of This Requested Update Elsewhere?

Not that I could find.

Thanks!

@yowainwright
Copy link
Owner

Thanks @Aarononomous ! Hope to get to this asap.

@tonebender
Copy link

I can second this. I'm also getting these Symbol-related results despite not having any Symbol in my source files. I skimmed https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol and tried to find any of its sub-functions and variables in my code (such as Symbol.matchAll or Symbol.keyFor() but didn't come up with anything.

@yowainwright
Copy link
Owner

yowainwright commented Mar 5, 2025

I pushed a beta version. Mind trying it out? 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants