putyourlightson / craft-spark

A real-time, template-driven hypermedia framework for Craft CMS.
MIT License
17 stars 0 forks source link

Sending variable to spark as an array #15

Open cloudgrayau opened 2 days ago

cloudgrayau commented 2 days ago

Bug Report

Hello,

Sending a variable into a spark component as an array value, kills the request and shows a blank white page. For example:

<main id="structure" data-on-load="{{ spark('_components/article', {
  id: entry.id,
  tags: entry.objTags.ids()
}) }}">

Plugin Version

1.0.0-alpha.5

Craft CMS Version

5.5

PHP Version

No response

bencroker commented 2 days ago

Please check the error logs for an exception message and stack trace.

cloudgrayau commented 1 day ago

It appears that trying to send any form of array variable, just kills the memory. Even with 2G set, it still dies.

[21-Nov-2024 09:48:19 Australia/Brisbane] PHP Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 262144 bytes) in /var/www/html/vendor/yiisoft/yii2/base/Module.php on line 784 [21-Nov-2024 09:48:19 Australia/Brisbane] PHP Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0

Sending a blank array, does the same thing:

<main id="structure" data-on-load="{{ spark('_components/article', {
  id: entry.id,
  tags: []
}) }}">
bencroker commented 1 day ago

Can you show me what’s in the template at _components/article?