添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account - Operating System: `Darwin` - Node Version: `v18.2.0` - Nuxt Version: `2.17.0-27947541.7f76ace` - Nitro Version: `1.0.0` - Package Manager: `[email protected]` - Builder: `webpack` - User Config: `ssr`, `target`, `server`, `env`, `head`, `plugins`, `buildModules`, `router`, `serverMiddleware`, `css`, `components`, `modules`, `sentry`, `axios`, `build`, `serverHandlers`, `devServerHandlers`, `devServer`, `typescript`, `bridge` - Runtime Modules: `@nuxtjs/[email protected]`, `@nuxtjs/[email protected]` - Build Modules: `()`, `@nuxtjs/[email protected]`, `@nuxtjs/[email protected]`, `@nuxtjs/[email protected]`, `@nuxt/[email protected]` ------------------------------

Reproduction

My nuxtjs version was
nuxt - 2.15.8

I have followed this:-
https://nuxt.com/docs/bridge/overview#feature-flags

Describe the bug

Everything works ok now, but i get this error

EventSource's response has a MIME type ("text/html") that is not "text/event-stream". Aborting the connection.

Additional context

Above request is fired continously

No response

To understand the core of the issue

text/event-stream is the official media type for Server Sent Events (SSE); it will prefix data bits with a data: prefix and you can also choose your prefix to change the meaning of that piece of data for the client. This media type is for browsers, as they support that using the EventSource JavaScript API.

You may need an additional loader to handle the result of these loaders. - occurs for useHead ready(nuxt) { // Write this hook in nuxt.config.js nuxt.hook('server:devMiddleware', async (devMiddleware) => { await nuxt.callHook('server:devHandler', fromNodeMiddleware(devMiddleware)); });

@galaxyblur
Have u deleted node_modules and installed again
Seems webPackHotUpdate plugin is not installed
Nuxt bridge installs webpacker and hotReloading module

https://github.com/nuxt/bridge/blob/c80e571b42d715d362f0b40161641043cedbe2ee/packages/bridge-schema/build.config.ts

I was using nuxt 2.15 and I upgraded it to nuxt bridge
But I am facing, template compilation issues and I have rollback everything.
I will wait for offcial guide migrating to Nuxt3

Cheers

Thanks @psahni -- I was missing the correct import statement for fromNodeMiddleware:

import { fromNodeMiddleware } from 'h3';

But doing a clean install and adding the hooks setting in config did help. It's still not perfect, I expect a fix in Nuxt-bridge from the nuxt team, but it's better! Thank you.