Skip to content

Browser warnings: Failed to load module script #25

@xiki808

Description

@xiki808

Hi! I'm trying to use this plugin in my Laravel v9 + Vue using Vite setup. I'm including the plugin in Vite config making sure not to gzip manifest.json, by removing json extension using the filter option:

...
    viteCompression({
      deleteOriginFile: true,
      filter: /.(js|mjs|css|html)$/i,
    }),
...

Once I run build, I go in the mainfest.json inside public and replace all asset files' extension to include .gz, Everything looks to load fine except for the browser giving me a blank screen and the following warning:

Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "application/octet-stream". Strict MIME type checking is enforced for module scripts per HTML spec.

image

Can someone help me solve this? Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions