© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
9 replies
Rina

Data not fetching on build

Hello all, I am a learner trying to deploy my project using Node.js React Vite and Supabase.

My data fetch is working on development. but when I build with
npm run build
npm run build
data fetch does not work and not seeing any error code.
I did follow https://supabase.com/docs/guides/getting-started/tutorials/with-react


require("dotenv").config({
  path: "./.env.local",
});

const supabaseUrl = process.env.VITE_SUPABASE_URL;
const supabaseKey = process.env.VITE_SUPABASE_ANON_KEY;

const { createClient } = require("@supabase/supabase-js");

const supabase = createClient(supabaseUrl, supabaseKey);

module.exports = supabase;
require("dotenv").config({
  path: "./.env.local",
});

const supabaseUrl = process.env.VITE_SUPABASE_URL;
const supabaseKey = process.env.VITE_SUPABASE_ANON_KEY;

const { createClient } = require("@supabase/supabase-js");

const supabase = createClient(supabaseUrl, supabaseKey);

module.exports = supabase;


This is my supabase server file and I have the url and key in .env.local in the root folder.
I appreciate your help.
Build a User Management App with React | Supabase Docs
Learn how to use Supabase in your React App.
Build a User Management App with React | Supabase Docs
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
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Error fetching data on page refresh
SupabaseSSupabase / help-and-questions
4y ago
Fetching Data Type Error
SupabaseSSupabase / help-and-questions
3y ago
Nuxt + Supabase, fetching data snippet
SupabaseSSupabase / help-and-questions
4y ago
Fetching data that contains a FK relation not working
SupabaseSSupabase / help-and-questions
4y ago