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

[🐞] Handle libraries that use $ in function names/only treat $ as a special character as suffix #7091

Open
Talinx opened this issue Nov 24, 2024 · 1 comment
Labels
STATUS-2: team is working on this Scheduled for work by the core team TYPE: bug Something isn't working

Comments

@Talinx
Copy link

Talinx commented Nov 24, 2024

Which component is affected?

Qwik Optimizer (rust)

Describe the bug

I want to use the peggy library (https://peggyjs.org/). This library uses $ in function names, e. g. peg$SyntaxError. This causes errors in Qwik, e. g. Error: Value cannot be serialized in _.SyntaxError, because it's a function named "peg$SyntaxError". You might need to convert it to a QRL using $(fn): const peg$SyntaxError =...

The Qwik documentation states that it converts $ suffixes. Here it is not a suffix, yet it causes this error. (I guess $ as suffix is only the suggested style.) Maybe this is a bug in the optimizer and it should only treat $ as a special symbol when it is a suffix of the function name?

Reproduction

https://github.com/Talinx/qwik-issue-example

Steps to reproduce

Run pnpm install followed by pnpm dev. Go to the site (http://localhost:5173/ by default. The error message will appear on the top of that site.

System Info

System:
    OS: Linux 6.12 Arch Linux
    CPU: (16) x64 AMD Ryzen 7 7840U w/ Radeon  780M Graphics
    Memory: 52.88 GB / 58.67 GB
    Container: Yes
    Shell: 5.2.37 - /usr/bin/bash
  Binaries:
    Node: 23.1.0 - /usr/bin/node
    Yarn: 1.22.22 - /usr/bin/yarn
    npm: 10.9.0 - /usr/bin/npm
    pnpm: 9.12.3 - /usr/bin/pnpm
  npmPackages:
    @builder.io/qwik: ^1.10.0 => 1.10.0 
    @builder.io/qwik-city: ^1.10.0 => 1.10.0 
    typescript: 5.4.5 => 5.4.5 
    undici: * => 6.21.0 
    vite: 5.3.5 => 5.3.5


### Additional Information

See https://github.com/QwikDev/qwik-evolution/discussions/194
@Talinx Talinx added STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working labels Nov 24, 2024
@shairez shairez moved this from Backlog to Upcoming in Qwik Development Nov 24, 2024
@shairez shairez added STATUS-2: team is working on this Scheduled for work by the core team and removed STATUS-1: needs triage New issue which needs to be triaged labels Nov 24, 2024
@JerryWu1234
Copy link
Contributor

There was an idea about this bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STATUS-2: team is working on this Scheduled for work by the core team TYPE: bug Something isn't working
Projects
Status: Upcoming
Development

No branches or pull requests

3 participants