Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

bug when expr contains Array

Open
#34 3 comments 1 reaction 1 assignee View on GitHub

@BQXBQX is already working on this.

Since Sep 24, 2025.

Assessment

This issue has not been assessed yet.

Description

const expr = compile("{a.type === 'dash' ? [2, 2] : [0, 0]}");
expect(expr({ type: 'line' })).toEqual([0, 0]);
expect(expr({ type: 'dash' })).toEqual([0, 0]);

Throw error:

FAIL  tests/case.test.ts > Some Integration Tests > should return valid value in lineDash
ExpressionError: Unexpected character: {
 ❯ tokenize src/tokenizer.ts:408:11
    406| 
    407|     // If we get here, we have an unexpected character
    408|     throw new ExpressionError(
       |           ^
    409|       `Unexpected character: ${input[pos]}`,
    410|       pos,
 ❯ compile src/compile.ts:19:18
 ❯ tests/case.test.ts:6:18
 ❯ node_modules/_@vitest_runner@3.2.4@@vitest/runner/dist/chunk-hooks.js:155:11
Dominant language
TypeScript
Stars
26
Forks
1
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from antvis/expr

All issues in antvis/expr

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.