Initialising Supabase client on latest version with nextjs

Hi, I just upgraded to latest rc of Supabase to use the new auth component, unfortunately, now I get the error attached in the image. I am not doing anything complicated, my supabaseClient.ts looks like this (ignore the keys I have them correctly being passed):
import { createClient } from '@supabase/supabase-js';

// Create a single supabase client for interacting with your database
export const supabase = createClient(
'https://xyzcompany.supabase.co',
'public-anon-key',
);
import { createClient } from '@supabase/supabase-js';

// Create a single supabase client for interacting with your database
export const supabase = createClient(
'https://xyzcompany.supabase.co',
'public-anon-key',
);
Login.tsx looks like this:
import { supabase } from '@/utils/supabaseClient';
import { Auth, ThemeSupa } from '@supabase/auth-ui-react';
import React, { useState } from 'react';

const Login = () => <Auth supabaseClient={supabase} />;
export default Login;
import { supabase } from '@/utils/supabaseClient';
import { Auth, ThemeSupa } from '@supabase/auth-ui-react';
import React, { useState } from 'react';

const Login = () => <Auth supabaseClient={supabase} />;
export default Login;
This is on version 12.2.2 of NextJS - any ideas? I haven't messed around in the web world for a long time so I am guessing it might be something in my tsconfig that I am missing blindly.
No description
3 Replies
pixtron
pixtron4y ago
can you run npm list @supabase/supabase-js and post the results?
lukehennerley
lukehennerleyOP4y ago
❯ npm list "@supabase/supabase-js"
platform@
└── @supabase/supabase-js@2.0.0-rc.6
❯ npm list "@supabase/supabase-js"
platform@
└── @supabase/supabase-js@2.0.0-rc.6
pixtron
pixtron4y ago
@lukehennerley to me it looks like your webpack config tree shakes the needed applySettingsDefaults method. Could you share these files: next.config.js, package.json and tsconfig.json Another thing; i just tried @supabase/auth-ui-react it seems to me that it still requires supabase v1 (but thats not the root of your error).

Did you find this page helpful?