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

Bug: Playground crashes viewing config with parserOptions not containing ecmaFeatures #450

Closed
1 task done
JoshuaKGoldberg opened this issue Jul 7, 2023 · 3 comments · Fixed by #451
Closed
1 task done
Assignees
Labels
accepted bug Something isn't working

Comments

@JoshuaKGoldberg
Copy link
Contributor

URL(s)

https://eslint.org/play/#eyJvcHRpb25zIjp7InBhcnNlck9wdGlvbnMiOnsic291cmNlVHlwZSI6InNjcmlwdCJ9fSwidGV4dCI6Ii8qZXNsaW50IG5vLWltcGxpY2l0LWdsb2JhbHM6IFwiZXJyb3JcIiovXG5cbnZhciBmb28gPSAxO1xuXG5mdW5jdGlvbiBiYXIoKSB7fVxuIn0=

What did you do?

  1. Encoded an eslint.org/play URL that contains { "parserOptions": { "sourceType": "script" } } under options
  2. Visited that URL -> the page does successfully render
  3. Clicked Versioning and Config in the right sidebar

What did you expect to happen?

If the user has encoded a parserOptions object that doesn't contain ecmaFeautures, the sidebar should still render properly when the config section is clicked.

What actually happened?

On section click, the page goes blank (except for the header) as a result of this crash:

playground.js:2 Uncaught TypeError: Cannot read properties of undefined (reading 'jsx')
    at playground.js:2:2175396
    at Array.filter (<anonymous>)
    at jv (playground.js:2:2175341)
    at wo (playground.js:2:131194)
    at ka (playground.js:2:142809)
    at Cl (playground.js:2:189016)
    at bu (playground.js:2:177131)
    at Eu (playground.js:2:177059)
    at yu (playground.js:2:176922)
    at ou (playground.js:2:173729)

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

Context: eslint/eslint#17306

@amareshsm
Copy link
Member

Good catch 👍

@mdjermanovic
Copy link
Member

I don't think this classifies as a bug. The playground was designed to only accept configurations that it generated itself because that was the only use case. Anyway, we can support passing partial configs if that's useful for eslint/eslint#17306.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants