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

The CJS build of Vite's Node API is deprecated. #6652

Closed
lcsd opened this issue Dec 29, 2023 · 5 comments · Fixed by #6660
Closed

The CJS build of Vite's Node API is deprecated. #6652

lcsd opened this issue Dec 29, 2023 · 5 comments · Fixed by #6660

Comments

@lcsd
Copy link

lcsd commented Dec 29, 2023

[REQUIRED] Environment info

firebase-tools: 13.0.2

Platform: Ubuntu

[REQUIRED] Test case

$> VITE (VUE3) start app , config VueFire with auth and hosting
$> firebase experiments:enabled webframeworks
$> firebase init hosting auth

[REQUIRED] Steps to reproduce

$> firebase emulators: start => ERRORS BUT
$> firebase deploy => deploys OK with folowinf MSG (from Vite 5.0)
"The CJS build of Vite's Node API is deprecated. See
https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated
for more details."

[REQUIRED] Expected behavior

No more CJS (node require) in firebase code

[REQUIRED] Actual behavior

  "The CJS build of Vite's Node API is deprecated. See 
          https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated
   for more details."

** MY firebase.json file;** see rewrites following Vite instructions for FireBase Deploy.

{
  "hosting": {
    "source": ".",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "frameworksBackend": {
      "region": "us-east1"
    },
    "site": "g2ato-v3p1-fb",
    "rewrites": [{
      "source": "**",
      "destination": "/index.html"
    }],
    "redirects": [],
    "headers": [{
        "source": "**/*.[jt]s",
        "headers": [{
            "key": "Set-Cookie",
            "value": "__FIREBASE_DEFAULTS__=xxx...;"
     }],
    "cleanUrls": true,
    "webFramework": "vite"
  },
  "emulators": {
    "hosting": {
      "port": 5000
    },
    "singleProjectMode": true
  }
}
@lcsd lcsd added the type: bug label Dec 29, 2023
@google-oss-bot
Copy link
Contributor

This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.

@leoortizz
Copy link
Member

Hey @lcsd I created a PR to fix the warning in #6660.

However, note that at the moment this is just a warning from Vite that should not break the build: https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated. It will only be removed in Vite 6, so as the current version is 5, everything should still work with CJS. I suspect the error you're getting with firebase emulators:start is something else, can you please double check?

@AdielCohen
Copy link

I did everything in:
https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated
And it didn't fix the problem.

I created new project with vite + REACT+ Typescript SWC (npm create vite@latest) And after that, I did deploy with Firebase
And I got two responses from terminal:

"The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details."
"While this integration is maintained by Googlers it is not a supported Firebase product.
Issues filed on GitHub will be addressed on a best-effort basis by maintainers and other community members."

@leoortizz
Copy link
Member

I did everything in: https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated And it didn't fix the problem.

I created new project with vite + REACT+ Typescript SWC (npm create vite@latest) And after that, I did deploy with Firebase And I got two responses from terminal:

"The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details." "While this integration is maintained by Googlers it is not a supported Firebase product. Issues filed on GitHub will be addressed on a best-effort basis by maintainers and other community members."

Hey @AdielCohen, note that this is just a warning that should not break anything in your app. As soon as we merge and release #6660 the warning will be gone.

@AdielCohen
Copy link

I did everything in: https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated And it didn't fix the problem.
I created new project with vite + REACT+ Typescript SWC (npm create vite@latest) And after that, I did deploy with Firebase And I got two responses from terminal:
"The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details." "While this integration is maintained by Googlers it is not a supported Firebase product. Issues filed on GitHub will be addressed on a best-effort basis by maintainers and other community members."

Hey @AdielCohen, note that this is just a warning that should not break anything in your app. As soon as we merge and release #6660 the warning will be gone.

I see, thank you very much!
Is there an estimated month for release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants