Open1
Nuxt3(安定版)で socket.io を動かす
![mizko](https://res.cloudinary.com/zenn/image/fetch/s--_WuRkwiT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_70/https://storage.googleapis.com/zenn-user-upload/avatar/bd5476acf9.jpeg)
Nuxt3のリリースバージョン( 3.0.0
)にしたら nuxt-socket-io
は最新版 3.0.12
にする
nuxt.config.ts
の書き方が変わる
export default defineNuxtConfig({
runtimeConfig: {
public: {
io: {
sockets: [
{
name: "test",
...
},
],
},
firebaseConfig: ...,
},
},
runtimeConfig
に他の設定をしている場合、 warning が発生するけど一応動く。。。
Type '{ io: NuxtSocketIoRuntimeOptions; firebaseConfig: ... }' is not assignable to type '{ io: NuxtSocketIoRuntimeOptions; }'.
Object literal may only specify known properties, and 'firebaseConfig' does not exist in type '{ io: NuxtSocketIoRuntimeOptions; }'.