question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

_nuxt/empty.js was blocked with vite:true and ssr:false

See original GitHub issue

Environment


  • Operating System: Linux
  • Node Version: v14.19.3
  • Nuxt Version: 2.16.0-27720022.54e852f
  • Nitro Version: 0.5.4
  • Package Manager: yarn@1.22.19
  • Builder: vite
  • User Config: bridge, ssr, serverHandlers, devServerHandlers, buildModules
  • Runtime Modules: -
  • Build Modules: (), @nuxt/bridge@3.0.0-27740081.058a6c1

Reproduction

  1. Open the default CodeSandbox template: https://codesandbox.io/p/github/nuxt/starter/tree/v2-bridge-codesandbox
  2. Replace nuxt.config.js with this:
import { defineNuxtConfig } from "@nuxt/bridge";

export default defineNuxtConfig({
  bridge: {
    vite: true
  },

  ssr: false
});

(or open this CodeSandbox where I already replaced the config: https://codesandbox.io/s/nuxt-bridge-vite-empty-error-ee3gjg?file=/nuxt.config.js)

  1. In Firefox, open the console (the error does not show in the sandbox console) and see the error:
Loading module from “https://ee3gjg.sse.codesandbox.io/_nuxt/empty.js” was blocked because of a disallowed MIME type (“text/html”).
Loading failed for the module with source “https://ee3gjg.sse.codesandbox.io/_nuxt/empty.js”.
  1. In Chrome open the console and see the error:
empty.js: Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
  1. See that the page does not load

Describe the bug

When using vite: true and ssr: false in Nuxt/bridge, the page does not load and in your browser console you find an error telling that the file empty.js was blocked because it has the wrong MIME-type.

Additional context

No response

Logs

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:13
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
saideepesh000commented, Oct 1, 2022

👍 , facing the same issue

2reactions
smortexacommented, Oct 11, 2022

We are facing the same issue too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found