© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
8 replies
arkade

Issue with Supabase Client and Dynamic Imports

Certainly! When posting on a developer forum, it's helpful to provide a clear and concise question. Here's a suggestion for your forum post:

Title: Issue with Supabase Client and Dynamic Imports



I'm encountering an issue with my Next.js project where I'm using the Supabase client with dynamic imports. The error message I'm receiving is as follows:


Import trace for requested module:
external "https://esm.sh/@supabase/supabase-js@2"
./config/supabaseClient.js
./app/waitlist/page.jsx
⨯ external "https://esm.sh/@supabase/supabase-js@2"
The target environment doesn't support dynamic import() syntax so it's not possible to use external type 'module' within a script

Import trace for requested module:
external "https://esm.sh/@supabase/supabase-js@2"
./config/supabaseClient.js
./app/waitlist/page.jsx
Here is my supabaseClient.js file:


Copy code
import { createClient } from 'https://esm.sh/@supabase/supabase-js@2';

const supabaseUrl = process.env.NEXT_APP_SUPABASE_URL;
const supabaseKey = process.env.NEXT_APP_ANON_KEY;
const supabase = createClient(supabaseKey, supabaseUrl);

export { supabase };
And here's a snippet from my page.jsx file:


import supabase from "@/config/supabaseClient";
// ...
I've tried adjusting the imports and making sure the dynamic import syntax is supported, but I'm still encountering this issue. Any insights or suggestions on how to resolve this would be greatly appreciated!
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Supabase edge functions and local imports
SupabaseSSupabase / help-and-questions
4mo ago
Apollo Client and Supabase
SupabaseSSupabase / help-and-questions
3y ago
Supabase SSR client with Clerk
SupabaseSSupabase / help-and-questions
7mo ago
.rpc() with python supabase-client
SupabaseSSupabase / help-and-questions
4y ago