Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Known Issue: F5 failed for Fluent UI Tab & Dashboard Tab #12801

Open
Yimin-Jin opened this issue Nov 28, 2024 · 2 comments
Open

Known Issue: F5 failed for Fluent UI Tab & Dashboard Tab #12801

Yimin-Jin opened this issue Nov 28, 2024 · 2 comments

Comments

@Yimin-Jin
Copy link
Contributor

Yimin-Jin commented Nov 28, 2024

Describe the bug
When serving projects using the Vite dev server, if you follow these steps to create a tab template/sample:

1. Create New App -> Tab -> React with Fluent UI
2. Create New App -> Tab -> Dashborad
3. View Samples -> Team Central Dashboard

you may encounter an error page in the browser console when pressing F5, with the following error:

_polyfill-node.process.js:1 Uncaught ReferenceError: global is not defined  
    at _polyfill-node.process.js:1:351  
    (anonymous) @ _polyfill-node.process.js:1  

Screenshots
image
image
Cause
The root cause of this issue is that some dependencies assume they are running in a Node.js environment and thus use the Node.js global variable global. However, in a browser environment, this variable is not defined, leading to the global is not defined error.

Workaround
To resolve this issue, you can define the global variable in the vite.config.js file. This workaround ensures compatibility with libraries that rely on Node.js global variables when running in a browser environment.
Here is an example of how to update the vite.config.js:

import { defineConfig } from 'vite';  
import react from '@vitejs/plugin-react';  
  
export default defineConfig({  
  plugins: [react()],  
  define: {  
    global: 'globalThis',  // Define global as globalThis  
  },  
});  

If you need more solutions, you can refer to the GitHub issue. This issue has been discussed in the Vite GitHub discussions: Uncaught ReferenceError: global is not defined when served from vite dev server

VS Code Extension Information

  • Version [v5.10.1, v5.11.2024112007 (pre-release)]

Upcoming Fix
We are actively working on a fix for this issue and plan to include it in an upcoming pre-release version, which will be available in the next couple of days.

Copy link
Contributor

Thank you for contacting us! Any issue or feedback from you is quite important to us. We will do our best to fully respond to your issue as soon as possible. Sometimes additional investigations may be needed, we will usually get back to you within 2 days by adding comments to this issue. Please stay tuned.

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs attention This issue needs the attention of a contributor. label Nov 28, 2024
@Yimin-Jin Yimin-Jin removed the needs attention This issue needs the attention of a contributor. label Nov 28, 2024
@Prasad-MSFT
Copy link

@Yimin-Jin, thanks for sharing details about the issue and recommended solution. This will be beneficial to developers who are facing this issue.

@Yimin-Jin Yimin-Jin added the needs attention This issue needs the attention of a contributor. label Nov 28, 2024
@Yimin-Jin Yimin-Jin changed the title Fluent UI Tab & Dashboard Tab Error Known Issue: Fluent UI Tab & Dashboard Tab Error Nov 28, 2024
@adashen adashen pinned this issue Nov 28, 2024
@Yimin-Jin Yimin-Jin changed the title Known Issue: Fluent UI Tab & Dashboard Tab Error Known Issue: F5 failed for Fluent UI Tab & Dashboard Tab Nov 28, 2024
@adashen adashen removed the needs attention This issue needs the attention of a contributor. label Dec 2, 2024
@wenytang-ms wenytang-ms added cherry-pick-hotfix hotfix that need to be merge into dev and release branch and removed cherry-pick-hotfix hotfix that need to be merge into dev and release branch labels Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants