nystudio107 / craft-vite

Allows the use of the Vite.js next generation frontend tooling with Craft CMS
MIT License
52 stars 16 forks source link

TypeError when setting errorEntry configuration to an array #76

Closed twitcher07 closed 1 year ago

twitcher07 commented 1 year ago

Describe the bug

The documentation says that you can set the errorEntry setting to a string or an array of strings. But I am getting a TypeError when I set it to an array of strings.

Here is my errorEntry setting:

'errorEntry' => [
        'src/scss/styles.scss',
        'src/js/main.js',
    ]

And the error I'm getting: image

To reproduce

Steps to reproduce the behaviour:

  1. Set errorEntry to an array of strings.

Expected behaviour

Vite plugin includes each file inside an array of strings on the frontend error page.

Versions

khalwat commented 1 year ago

Addressed in: https://github.com/nystudio107/craft-vite/commit/648b40549e7199cd663389810c251aa9fe2f066a & https://github.com/nystudio107/craft-vite/commit/d193c93e1afdac12917b9830aa877d00a11028a1

Craft CMS 3:

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-vite": "dev-develop as 1.0.32”,

Then do a composer clear-cache && composer update

…..

Craft CMS 4:

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-vite": "dev-develop-v4 as 4.0.7”,

Then do a composer clear-cache && composer update

twitcher07 commented 1 year ago

@khalwat awesome! thank you for fixing it so quickly.