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

Failed transformation due to bad scope analysis for catch blocks #11806

Closed
7 tasks done
gtm-nayan opened this issue Jan 24, 2023 · 1 comment · Fixed by #11811
Closed
7 tasks done

Failed transformation due to bad scope analysis for catch blocks #11806

gtm-nayan opened this issue Jan 24, 2023 · 1 comment · Fixed by #11811
Labels
feat: ssr p2-edge-case Bug, but has workaround or limited in scope (priority)

Comments

@gtm-nayan
Copy link
Contributor

Describe the bug

Ben has described the issue here, #10289, not sure if it's a regression or a case was missed then, but I ran into it again today when the shadowing variable name was inside a catch block

Reproduction

https://github.com/gtm-nayan/vite-import-transformation-bug

Steps to reproduce

Clone the repo

pnpm i && pnpm dev

Failed transformation may be easier to see if you pause on the debugger

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
    CPU: (4) x64 AMD Ryzen 7 5800H with Radeon Graphics
    Memory: 2.98 GB / 6.70 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 18.12.1 - ~/.local/share/pnpm/node
    Yarn: 1.22.19 - /mnt/wslg/runtime-dir/fnm_multishells/9196_1674575406312/bin/yarn
    npm: 9.2.0 - ~/.local/share/pnpm/npm
  npmPackages:
    vite: ^4.0.0 => 4.0.4

Used Package Manager

pnpm

Logs

No response

Validations

@sapphi-red sapphi-red added p3-minor-bug An edge case that only affects very specific usage (priority) feat: ssr labels Jan 24, 2023
@sapphi-red sapphi-red added p2-edge-case Bug, but has workaround or limited in scope (priority) and removed p3-minor-bug An edge case that only affects very specific usage (priority) labels Jan 24, 2023
@gtm-nayan
Copy link
Contributor Author

Turns out it's not related to catch, the bug exists for normal blocks as well. Updated the repo with a simpler case.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat: ssr p2-edge-case Bug, but has workaround or limited in scope (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants