firebase / firebase-tools

The Firebase Command Line Tools
MIT License
4.01k stars 926 forks source link

Firebase deploy not working on hosting emulator for SvelteKit v1.16.2, getting stuck in vite process. #5827

Closed akashlama1998-icloud closed 1 year ago

akashlama1998-icloud commented 1 year ago

[REQUIRED] Environment info

firebase-tools: 12.0.0

Platform: Windows 11 Version 22H2

[REQUIRED] Test case

firebase emulators:start --import ./.firebase/export --export-on-exit ./.firebase/export

[REQUIRED] Steps to reproduce

npm create svelte@latest my-app

┌  Welcome to SvelteKit!
│
◇  Which Svelte app template?
│  Skeleton project
│
◇  Add type checking with TypeScript?
│  Yes, using TypeScript syntax
│
◇  Select additional options (use arrow keys/space bar)
│  Add ESLint for code linting, Add Prettier for code formatting, Add 
Playwright for browser testing, Add Vitest for unit testing
│
└  Your project is ready!
firebase init

Database and (optionally) provision default instance
( ) Realtime Database: Configure a security rules file for Realtime Database and (optionally) provision default instance
(*) Firestore: Configure security rules and indexes files for Firestore
(*) Functions: Configure a Cloud Functions directory and its files   
(*) Hosting: Configure files for Firebase Hosting and (optionally) set up GitHub Action deploys
( ) Hosting: Set up GitHub Action deploys
(*) Storage: Configure a security rules file for Cloud Storage       
(*) Emulators: Set up local emulators for Firebase products
( ) Remote Config: Configure a template file for Remote Config       
(*) Extensions: Set up an empty Extensions manifest

? What language would you like to use to write Cloud Functions?       
TypeScript
? Do you want to use ESLint to catch probable bugs and enforce style? 
Yes
? Do you want to install dependencies with npm now?
Yes

? Detected an existing SvelteKit codebase in the current directory,   
should we use this?
Yes

? In which region would you like to host server-side content, if      
applicable?
asia-east1 (Taiwan)

? Set up automatic builds and deploys with GitHub?
No

? Which Firebase emulators do you want to set up? Press Space to      
select emulators, then Enter to confirm your choices.
(*) Authentication Emulator
(*) Functions Emulator
(*) Firestore Emulator
( ) Database Emulator
(*) Hosting Emulator
(*) Pub/Sub Emulator
(*) Storage Emulator
( ) Eventarc Emulator

? Which port do you want to use for the auth emulator?
9099

? Which port do you want to use for the functions emulator?
5001

? Which port do you want to use for the firestore emulator?
8080      

? Which port do you want to use for the hosting emulator?
5000        

? Which port do you want to use for the pubsub emulator?
8085

? Which port do you want to use for the storage emulator?
9199        

? Would you like to enable the Emulator UI?
Yes

? Which port do you want to use for the Emulator UI (leave empty to use any available port)?
Yes

? Would you like to download the emulators now?
Yes

=== Extensions Setup

i  Writing configuration info to firebase.json...
i  Writing project information to .firebaserc...

+  Firebase initialization complete!

firebase emulators:start --import ./.firebase/export --export-on-exit ./.firebase/export

[REQUIRED] Expected behavior

Expected to see the app running sucessfully.

[REQUIRED] Actual behavior

It is getting stuck in the vite process. You know when when we do vite dev, it's getting stuck there. The output is below 👇

i  emulators: Starting emulators: auth, functions, firestore, hosting, pubsub, storage, extensions

   Thank you for trying our experimental support for SvelteKit on Firebase Hosting.
   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.

   Documentation: https://firebase.google.com/docs/hosting/frameworks/frameworks-overview
   File a bug: https://github.com/firebase/firebase-tools/issues/new?template=bug_report.md
   Submit a feature request: https://github.com/firebase/firebase-tools/issues/new?template=feature_request.md

   We'd love to learn from you. Express your interest in helping us shape the future of Firebase Hosting: https://goo.gle/41enW5X

Forced re-optimization of dependencies

  VITE v4.3.5  ready in 1507 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
viewee22 commented 1 year ago

Me, too. It doesn't work.

aalej commented 1 year ago

Hi @akashlama1998-icloud, thanks for the detailed steps you provided. I tried to replicate the issue you mentioned but I was able to start the Firebase emulator without any issues. Just to verify, are you having issues with both firebase emulators:start and firebase deploy?

Also, could you let me know which Node version you’re using and if there are any issues if you try running npm run dev?

I’m using the following to try and replicate the issue:

jamesdaniels commented 1 year ago

IMO this is the same root cause as #5561