nuxt-modules / supabase

Supabase module for Nuxt.
https://supabase.nuxtjs.org
MIT License
673 stars 123 forks source link

Remove dead code #217

Open stlbucket opened 1 year ago

stlbucket commented 1 year ago

from https://github.com/nuxt-modules/supabase/blob/main/src/module.ts

both referenced issues are closed. this is really a chore.

    // Transpile @supabase/go-true package only on client side
    // TODO: Remove when packages fixed with valid ESM exports
    // https://github.com/nuxt-community/supabase-module/issues/54
    nuxt.options.build.transpile.push(
      ({ isServer }) => !isServer && '@supabase/gotrue-js'
    )

    // Transpile websocket only for non dev environments (except cloudflare)
    if (!nuxt.options.dev && !['cloudflare'].includes(process.env.NITRO_PRESET as string)) {
      nuxt.options.build.transpile.push('websocket')
    }

    // Optimize @supabase/ packages for dev
    // TODO: Remove when packages fixed with valid ESM exports
    // https://github.com/supabase/gotrue/issues/1013
    extendViteConfig((config) => {
      config.optimizeDeps = config.optimizeDeps || {}
      config.optimizeDeps.include = config.optimizeDeps.include || []
      config.optimizeDeps.exclude = config.optimizeDeps.exclude || []
      config.optimizeDeps.include.push(
        '@supabase/functions-js',
        '@supabase/gotrue-js',
        '@supabase/postgrest-js',
        '@supabase/realtime-js',
        '@supabase/storage-js',
        '@supabase/supabase-js'
      )
    })
Aietes commented 1 year ago

The last part is still required, I tested it. While the related issue 1013 has been closed, the issue's root cause is still not fixed. They removed the dependency for one module causing this error, but there are some more that run into the same issue when optimize deps for the supabase js libraries is not done.

stlbucket commented 1 year ago

@Aietes - would this be related, you think?

https://github.com/supabase/supabase/issues/16100#issuecomment-1657269919