withastro / compiler

The Astro compiler. Written in Go. Distributed as WASM.
Other
503 stars 59 forks source link

🐛 BUG: spread AttributeNode cannot accept call expression with argument(s) #871

Closed cm-ayf closed 1 year ago

cm-ayf commented 1 year ago

What version of @astrojs/compiler are you using?

2.1.0

What package manager are you using?

npm

What operating system are you using?

Mac

Describe the Bug

AttributeNode with kind: "spread" cannot accept Identifier followed by Arguments with one or more Literals; such as

<p {...propsFn("bug")}>This produces parse error</p>

Error from StackBlitz reproduction:

Error: Transform failed with 1 error:
/home/projects/github-cwnppb/src/pages/index.astro:33:565: ERROR: Expected ")" but found "bug"
    at failureErrorWithLog (<anonymous>)
    at  (<anonymous>)
    at  (<anonymous>)
    at handleIncomingPacket (<anonymous>)
    at readFromStdout (<anonymous>)
    at  (node:events:42:9213)
    at addChunk (node:internal/streams/readable:105:4113)
    at readableAddChunk (node:internal/streams/readable:105:3816)
    at onStreamRead (node:internal/stream_base_commons:158:2345)
    at  (https://githubcwnppb-pz52.w-corp.staticblitz.com/blitz.f8b0f7c7.js:350:309340)

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-cwnppb?file=src%2Fpages%2Findex.astro%3AL21