nystudio107 / craft-vite

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

Last Vite update breaks the site #25

Closed jan-dh closed 2 years ago

jan-dh commented 2 years ago

Describe the bug

Web page now only shows

[
    'resources/js/head.js' => [
        'type' => 'file'
        'url' => 'head.efc7db5e.js'
        'options' => [
            'type' => 'module'
            'crossorigin' => true
            'onload' => 'e=new CustomEvent(\'vite-script-loaded\', {detail:{path: \'resources/js/head.js\'}});document.dispatchEvent(e);'
        ]
    ]
    'vendor.e2e1bd24.js' => [
        'crossorigin' => true
        'type' => 'import'
        'url' => 'vendor.e2e1bd24.js'
        'integrity' => ''
    ]
]

To reproduce

Steps to reproduce the behaviour:

  1. Update to last version
  2. Refresh page
  3. See error message
    [
    'resources/js/head.js' => [
        'type' => 'file'
        'url' => 'head.efc7db5e.js'
        'options' => [
            'type' => 'module'
            'crossorigin' => true
            'onload' => 'e=new CustomEvent(\'vite-script-loaded\', {detail:{path: \'resources/js/head.js\'}});document.dispatchEvent(e);'
        ]
    ]
    'vendor.e2e1bd24.js' => [
        'crossorigin' => true
        'type' => 'import'
        'url' => 'vendor.e2e1bd24.js'
        'integrity' => ''
    ]
    ]

Expected behaviour

It doesn't break my website 😅

Screenshots

image

Versions

mdominguez commented 2 years ago

Can confirm. And not sure which versions of this plugin and/or Craft, vite.js to rollback to in order to get it working again..

khalwat commented 2 years ago

Fixed in 1.0.23 -> https://github.com/nystudio107/craft-vite/releases/tag/1.0.23