The Firebase Login functionality is experiencing issues on the deployed Next.js application, although it functions correctly when running locally

After developing a Next.js app with Firebase Google login functionality, everything was running smoothly in my local environment. However, upon deploying it to Railway and Vercel, the login feature seemed to malfunction. Whenever a user attempted to click on the login button, the pop-up window failed to appear.

I am wondering if this issue could be related to the PORT number. I came across some suggestions mentioning env.PORT || 3000 as part of the solution. Could someone provide further details or insights on how to resolve this?

Answer №2

I have found success with two key steps.

  1. Configuring the authorized domain in Firebase (Authentication > Settings > Authorized domains)
  2. Ensuring the environment variables in Vercel are properly set by removing any unnecessary quotes (Vercel > Your project > Settings > Environment Variables). Simply click to edit each firebase variable and remove any surrounding quotes.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The functionality of react-router-dom's NavLink isActive feature seems to be unreliable

We are currently immersed in a React.js project. I am in the process of setting up multiple pages using react-router-dom and my goal is to alter the active icon by using NavLink. The icon+sel signifies the active page. render() { const oddEvent = (mat ...

Issue "unable to use property "useEffect", dispatcher is undefined" arises exclusively when working with a local npm package

I am currently in the process of creating my very own private npm package to streamline some components and functions that I frequently use across various React TypeScript projects. However, when I try to install the package locally using its local path, ...

Tips for dynamically displaying a Material UI dialog with smooth fade effects

I am currently developing a basic application that lists users. Whenever I click on a user, I want to display a dialog box with specific information about that user. I have attempted to achieve this using Material UI's Dialog component in different wa ...

Tips for clearing the input field after submitting data using fetch and ensuring successful execution of the code

Seeking assistance with my React chat application. I am using a "POST" request via fetch to send new messages in a conversation. However, I am encountering difficulty in clearing the input field after sending a message. Additionally, I need to handle error ...

Tips for creating a mock for a function that yields a JSX Element

I am facing a problem where I have a function that returns a JSX Element. Here is a snippet of the code: myFunction.jsx const myFunction = (props) => { // ... do something with props return <MyElement {...newProps} /> } // MyElement.j ...

Stopping the infinite refresh issue in your React webpack application

Every time I modify the TS file, Webpack keeps refreshing the page without stopping. The console message reads: "@ebpack 5.66.0 compiled successfully" I've searched online and experimented with various plugins, but none of them seem to solve the issu ...

React Link updates the URL without re-rendering the view

I'm encountering an issue with the <Link to=""> element in React. When I click on it, the URL changes but the view remains the same. However, upon refreshing the page, the correct component is displayed indicating that the router is functioning ...

Error: The React Material-UI modal is encountering a type error where it cannot access the property 'hasOwnProperty' of an undefined value

Whenever I include a modal in one of my classes, I encounter this error. Error: Unable to access property 'hasOwnProperty' of undefined Here is a simple example where I am attempting to display a basic modal at all times. Any suggestions? I h ...

Stopping Accordion Title from Moving Vertically in Material-UI

Just finished creating this accordion which will be used as a menu item. However, I've encountered an issue where clicking on the Main title causes the accordion summary to move downward vertically. Any suggestions on how to keep the Main tile fixed ...

Tips for simulating changing data in snapshot tests?

Two challenge are puzzling me currently: The snapshot test for a router page includes custom routers with guards specifically for logged in users. Each time I run this test, a different generated key is produced. I am using new Date() in a date pick ...

Tips for creating a sleek and modern MUI table with a dark theme

I am struggling to create a dark theme for the Table component from MUI. I attempted to use styled() and the sx prop to customize the appearance, but unfortunately, both methods failed to produce the desired dark theme. The table currently looks quite unsi ...

Difficulty fetching data on the frontend with Typescript, React, Vite, and Express

I'm currently working on an app utilizing Express in the backend and React in the frontend with typescript. This is also my first time using Vite to build the frontend. While my APIs are functioning correctly, I am facing difficulties fetching data on ...

Attempting to integrate information stored in Firebase into a FlatList component

Hello, I am completely new to using React and Firebase. Even though I have followed a few tutorials, I feel quite lost at the moment. My current struggle involves adding data from my Firebase database into my flatlist. The error message I receive is [Unhan ...

Creating a dropdown menu for an extensive list of 100 menu items: a step-by-step guide

In my React JS front-end project, I have implemented a drop-down menu using Material-UI. Currently, the menu items are hardcoded which works fine for a small number of items. However, this approach becomes cumbersome when dealing with a larger number of ...

Tips on automatically navigating to a new webpage after the user logs in with react.js

I'm exploring the world of ReactJS and currently experimenting with how to redirect a user after they register on my page. Below is a snippet from my App.js file where I have set up a registration form. import React, { useState } from "react" ...

Error: Unable to retrieve the name of the element because it is undefined

After updating to the latest version of NEXTUI, I encountered a new issue. Whenever I click on a NEXTUI Button that is nested within a Link from Next.js, I receive an error message stating: TypeError: Cannot read properties of undefined (reading 'node ...

Next Js (version 13.4.4-canary.2) is reporting that NEXT_PUBLIC_BASE_URL is currently undefined

I currently have two .env files set up: NEXT_PUBLIC_BASE_URL=http://localhost:3000 One is a simple .env file and the other is a .env.local file. NEXT_PUBLIC_BASE_URL=http://localhost:3000 Within my project, I am utilizing the new nextjs app folder struct ...

What is the best way to prevent a decrease from reaching zero in React when using the useState hook?

Currently, I am developing a simplistic card-battle style game using React. In this game, the useState hook is utilized to dynamically render the HP of selected characters. However, there is an issue where the opponent's HP can go negative instead of ...

Tips for customizing container maxWidth based on breakpoints with muiTheme in material-ui

Trying to wrap my head around the usage of createMuiTheme and adjusting maxWidth for different breakpoints I've set up. Currently, these are the values I'm working with: import { Container as Container_, Grid } from '@material-ui/core' ...

Displaying the format when entering a value with react-number-format

How to Display Format Only After Full Value Inserted in react-number-format I recently implemented the react-number-format package for formatting phone numbers. import { PatternFormat } from 'react-number-format'; <PatternFormat value={v ...