nuxt-modules / partytown

Partytown integration for Nuxt. Run third-party scripts from a web worker.
MIT License
318 stars 8 forks source link

@nuxtjs/partytown is not working with nuxt 3 #58

Closed anish2690 closed 2 years ago

anish2690 commented 2 years ago
import { defineNuxtConfig } from 'nuxt3'

export default defineNuxtConfig({
  modules: ['@nuxtjs/partytown'],
  partytown: {
    forward: ['$crisp', '$crisp.push'],
    debug: true
  },
  meta: {
    script: [
      // Insert your CRISP Script here e.g.:
      { children: 'window.$crisp = []; window.CRISP_WEBSITE_ID = "0000"' },
      { src: 'https://client.crisp.chat/l.js', async: true, type: 'text/partytown' } 
    ]
  }
})

Worker not getting initialised

image
danielroe commented 2 years ago

This is the issue: https://github.com/nuxt/framework/pull/4304 - the nitro:generate hook was removed.

TrungRueta commented 2 years ago

maybe use nitro:start will be solution ?

danielroe commented 2 years ago

Thanks for the issue - we're now using new nitro publicAssets to directly add + serve partytown directory: https://github.com/nuxt-community/partytown-module/commit/bf4cfca4df10a009abf2c16bfc7edf7be0a4efeb.

Issue should be resolved in 0.1.1.