Skip to content

Nuxt3 with Web Frameworks fails to deploy SSR Function on second deploy. #5995

Closed

Description

@CharlieDigital

[REQUIRED] Environment info

firebase-tools: 12.4.0

Platform: macOS

[REQUIRED] Test case

Repo with sample project here: https://github.com/CharlieDigital/nuxt3-firebase

Summary of the issue: when deploying a Nuxt3 SSR application using the experimental Web Frameworks, the Function deploys correctly the first time. However, subsequent deployments of the Function will fail with an error:

npm ERR! code EINTEGRITY
npm ERR! sha512-+t1FbVRm+BhU6maUuibt9qllRHbu+ejCT4pcHhOwIf++vKFIaApT36R2Bl6MolI1W3E5gCxefJ4eE61xdcJdbw== integrity checksum failed when using sha512: wanted sha512-+t1FbVRm+BhU6maUuibt9qllRHbu+ejCT4pcHhOwIf++vKFIaApT36R2Bl6MolI1W3E5gCxefJ4eE61xdcJdbw== but got sha512-4xZuVCUPIH2ddVjyo2EnyFDN8iCRvuDLvdGhl0Fu+1NQrZXFdvjQZ8ZtdLr8lg1w2xxrwQQs96g7/uVyLs3/TA==. (605756 bytes)

(See the full log below).

It appears as if the packaging step somehow fails on subsequent deploys.

[REQUIRED] Steps to reproduce

  1. Initialize Nuxt application in a new directory web
  2. Make sure experimental Web Frameworks has been installed and enabled
  3. Initialize Firebase in the directory; the Firebase CLI detects the Nuxt application
  4. firebase emulators:start
  5. Application works as expected in local emulator
  6. Uncomment the sample helloWorld function in the /functions directory
  7. firebase deploy
  8. Application and helloWorld function deploys as expected.
    1. Static page: https://nuxt3-firebase-fn-2.web.app/
    2. Client rendered page: https://nuxt3-firebase-fn-2.web.app/client-app
    3. Server rendered page: https://nuxt3-firebase-fn-2.web.app/rendered
  9. firebase deploy again
  10. Application fails to deploy with an error (see below)

[REQUIRED] Expected behavior

The Firebase generated 2nd gen function deploys correctly on the subsequent deploys.

[REQUIRED] Actual behavior

Fails with the following error when deploying the SSR function:

➜  web git:(main) ✗ firebase deploy        

   Thank you for trying our experimental support for Nuxt 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

Nuxi 3.5.3                                                                                                                                                                                                                                               10:29:02 PM

 WARN  Changing NODE_ENV from development to production, to avoid unintended behavior.                                                                                                                                                                   10:29:02 PM

Nuxt 3.5.3 with Nitro 2.4.1                                                                                                                                                                                                                              10:29:02 PM
ℹ Building client...                                                                                                                                                                                                                                     10:29:04 PM
ℹ vite v4.3.9 building for production...                                                                                                                                                                                                                 10:29:04 PM
ℹ ✓ 104 modules transformed.                                                                                                                                                                                                                             10:29:04 PM
ℹ .nuxt/dist/client/manifest.json                        2.79 kB │ gzip:  0.48 kB                                                                                                                                                                        10:29:05 PM
ℹ .nuxt/dist/client/_nuxt/error-500.aa16ed4d.css         1.95 kB │ gzip:  0.74 kB                                                                                                                                                                        10:29:05 PM
ℹ .nuxt/dist/client/_nuxt/error-404.23f2309d.css         3.63 kB │ gzip:  1.12 kB                                                                                                                                                                        10:29:05 PM
ℹ .nuxt/dist/client/_nuxt/index.dbd4816f.js              0.19 kB │ gzip:  0.17 kB                                                                                                                                                                        10:29:05 PM
ℹ .nuxt/dist/client/_nuxt/index.9c99f986.js              0.19 kB │ gzip:  0.18 kB                                                                                                                                                                        10:29:05 PM
ℹ .nuxt/dist/client/_nuxt/index.a0e7d39b.js              0.19 kB │ gzip:  0.17 kB                                                                                                                                                                        10:29:05 PM
ℹ .nuxt/dist/client/_nuxt/error-component.d1b9c792.js    1.07 kB │ gzip:  0.60 kB                                                                                                                                                                        10:29:05 PM
ℹ .nuxt/dist/client/_nuxt/error-500.1463cc05.js          1.88 kB │ gzip:  0.99 kB                                                                                                                                                                        10:29:05 PM
ℹ .nuxt/dist/client/_nuxt/default.b7d5931e.js            2.42 kB │ gzip:  1.17 kB                                                                                                                                                                        10:29:05 PM
ℹ .nuxt/dist/client/_nuxt/error-404.9294bca1.js          6.50 kB │ gzip:  2.88 kB                                                                                                                                                                        10:29:05 PM
ℹ .nuxt/dist/client/_nuxt/entry.e17c78b9.js            135.91 kB │ gzip: 51.40 kB                                                                                                                                                                        10:29:05 PM
ℹ ✓ built in 934ms                                                                                                                                                                                                                                       10:29:05 PM
✔ Client built in 940ms                                                                                                                                                                                                                                  10:29:05 PM
ℹ Building server...                                                                                                                                                                                                                                     10:29:05 PM
ℹ vite v4.3.9 building SSR bundle for production...                                                                                                                                                                                                      10:29:05 PM
ℹ ✓ 60 modules transformed.                                                                                                                                                                                                                              10:29:05 PM
ℹ .nuxt/dist/server/_nuxt/error-404-styles.a5c3f351.mjs        0.08 kB                                                                                                                                                                                   10:29:05 PM
ℹ .nuxt/dist/server/_nuxt/error-500-styles.6b5b5ff2.mjs        0.08 kB                                                                                                                                                                                   10:29:05 PM
ℹ .nuxt/dist/server/styles.mjs                                 0.35 kB                                                                                                                                                                                   10:29:05 PM
ℹ .nuxt/dist/server/_nuxt/index-e12b288f.js                    0.22 kB │ map:  5.28 kB                                                                                                                                                                   10:29:05 PM
ℹ .nuxt/dist/server/_nuxt/index-288fd688.js                    0.95 kB │ map:  0.12 kB                                                                                                                                                                   10:29:05 PM
ℹ .nuxt/dist/server/_nuxt/index-69d39588.js                    0.96 kB │ map:  0.12 kB                                                                                                                                                                   10:29:05 PM
ℹ .nuxt/dist/server/_nuxt/index-445ba6f5.js                    0.97 kB │ map:  0.12 kB                                                                                                                                                                   10:29:05 PM
ℹ .nuxt/dist/server/_nuxt/island-renderer-5c97736d.js          1.09 kB │ map:  1.41 kB                                                                                                                                                                   10:29:05 PM
ℹ .nuxt/dist/server/_nuxt/error-component-95918ea8.js          2.04 kB │ map:  2.71 kB                                                                                                                                                                   10:29:05 PM
ℹ .nuxt/dist/server/_nuxt/error-500-styles-1.mjs-0a86f27a.js   2.17 kB │ map:  0.12 kB                                                                                                                                                                   10:29:05 PM
ℹ .nuxt/dist/server/_nuxt/error-dev-styles-1.mjs-90bc7cbc.js   2.46 kB │ map:  0.12 kB                                                                                                                                                                   10:29:05 PM
ℹ .nuxt/dist/server/_nuxt/error-500-25c9031f.js                3.09 kB │ map:  3.78 kB                                                                                                                                                                   10:29:05 PM
ℹ .nuxt/dist/server/_nuxt/error-404-styles-1.mjs-6ef6e240.js   3.86 kB │ map:  0.12 kB                                                                                                                                                                   10:29:05 PM
ℹ .nuxt/dist/server/_nuxt/default-ee23b015.js                  4.95 kB │ map:  7.58 kB                                                                                                                                                                   10:29:05 PM
ℹ .nuxt/dist/server/_nuxt/error-404-0251400b.js                9.71 kB │ map: 18.88 kB                                                                                                                                                                   10:29:05 PM
ℹ .nuxt/dist/server/server.mjs                                28.49 kB │ map: 68.58 kB                                                                                                                                                                   10:29:05 PM
ℹ ✓ built in 385ms                                                                                                                                                                                                                                       10:29:05 PM
✔ Server built in 393ms                                                                                                                                                                                                                                  10:29:05 PM
✔ Generated public .output/public                                                                                                                                                                                                                  nitro 10:29:05 PM
ℹ Initializing prerenderer                                                                                                                                                                                                                         nitro 10:29:05 PM
ℹ Prerendering 1 routes                                                                                                                                                                                                                            nitro 10:29:05 PM
  ├─ / (23ms)                                                                                                                                                                                                                                      nitro 10:29:05 PM
ℹ Building Nitro Server (preset: node)                                                                                                                                                                                                             nitro 10:29:05 PM
✔ Nitro server built                                                                                                                                                                                                                               nitro 10:29:07 PM
  ├─ .output/server/chunks/app/_nuxt/default-ee23b015.mjs (5.25 kB) (1.81 kB gzip)
  ├─ .output/server/chunks/app/_nuxt/default-ee23b015.mjs.map (5.29 kB) (1.56 kB gzip)
  ├─ .output/server/chunks/app/_nuxt/error-404-0251400b.mjs (9.81 kB) (3.13 kB gzip)
  ├─ .output/server/chunks/app/_nuxt/error-404-0251400b.mjs.map (8.03 kB) (1.98 kB gzip)
  ├─ .output/server/chunks/app/_nuxt/error-404-styles.a5c3f351.mjs (3.92 kB) (1.25 kB gzip)
  ├─ .output/server/chunks/app/_nuxt/error-404-styles.a5c3f351.mjs.map (376 B) (233 B gzip)
  ├─ .output/server/chunks/app/_nuxt/error-500-25c9031f.mjs (3.15 kB) (1.4 kB gzip)
  ├─ .output/server/chunks/app/_nuxt/error-500-25c9031f.mjs.map (1.7 kB) (623 B gzip)
  ├─ .output/server/chunks/app/_nuxt/error-500-styles.6b5b5ff2.mjs (2.22 kB) (864 B gzip)
  ├─ .output/server/chunks/app/_nuxt/error-500-styles.6b5b5ff2.mjs.map (376 B) (233 B gzip)
  ├─ .output/server/chunks/app/_nuxt/error-component-95918ea8.mjs (2.07 kB) (903 B gzip)
  ├─ .output/server/chunks/app/_nuxt/error-component-95918ea8.mjs.map (2.41 kB) (823 B gzip)
  ├─ .output/server/chunks/app/_nuxt/index-288fd688.mjs (1.11 kB) (534 B gzip)
  ├─ .output/server/chunks/app/_nuxt/index-288fd688.mjs.map (767 B) (375 B gzip)
  ├─ .output/server/chunks/app/_nuxt/index-445ba6f5.mjs (1.13 kB) (544 B gzip)
  ├─ .output/server/chunks/app/_nuxt/index-445ba6f5.mjs.map (767 B) (373 B gzip)
  ├─ .output/server/chunks/app/_nuxt/index-69d39588.mjs (1.13 kB) (545 B gzip)
  ├─ .output/server/chunks/app/_nuxt/index-69d39588.mjs.map (767 B) (373 B gzip)
  ├─ .output/server/chunks/app/_nuxt/island-renderer-5c97736d.mjs (1.25 kB) (594 B gzip)
  ├─ .output/server/chunks/app/_nuxt/island-renderer-5c97736d.mjs.map (932 B) (449 B gzip)
  ├─ .output/server/chunks/app/client.manifest.mjs (3.32 kB) (573 B gzip)
  ├─ .output/server/chunks/app/client.manifest.mjs.map (2.48 kB) (482 B gzip)
  ├─ .output/server/chunks/app/server.mjs (28.6 kB) (7.76 kB gzip)
  ├─ .output/server/chunks/app/server.mjs.map (34.1 kB) (5.65 kB gzip)
  ├─ .output/server/chunks/app/styles.mjs (420 B) (243 B gzip)
  ├─ .output/server/chunks/app/styles.mjs.map (388 B) (229 B gzip)
  ├─ .output/server/chunks/error-500.mjs (4.26 kB) (1.82 kB gzip)
  ├─ .output/server/chunks/error-500.mjs.map (1.09 kB) (411 B gzip)
  ├─ .output/server/chunks/handlers/renderer.mjs (9.76 kB) (3.09 kB gzip)
  ├─ .output/server/chunks/handlers/renderer.mjs.map (11.1 kB) (2.28 kB gzip)
  ├─ .output/server/chunks/nitro/node.mjs (18.8 kB) (5.47 kB gzip)
  ├─ .output/server/chunks/nitro/node.mjs.map (21.6 kB) (3.86 kB gzip)
  ├─ .output/server/chunks/rollup/_virtual_head-static.mjs (301 B) (217 B gzip)
  ├─ .output/server/chunks/rollup/_virtual_head-static.mjs.map (111 B) (112 B gzip)
  ├─ .output/server/index.mjs (420 B) (252 B gzip)
  └─ .output/server/package.json (1.21 kB) (466 B gzip)
Σ Total size: 2.82 MB (681 kB gzip)

up to date in 231ms

24 packages are looking for funding
  run `npm fund` for details

=== Deploying to 'nuxt3-firebase-fn-2'...

i  deploying functions, hosting
Running command: npm --prefix "$RESOURCE_DIR" run lint

> lint
> eslint --ext .js,.ts .

Running command: npm --prefix "$RESOURCE_DIR" run build

> build
> tsc

✔  functions: Finished running predeploy script.
i  functions: preparing codebase default for deployment
i  functions: preparing codebase firebase-frameworks-nuxt3-firebase-fn-2 for deployment
i  functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i  functions: ensuring required API cloudbuild.googleapis.com is enabled...
i  artifactregistry: ensuring required API artifactregistry.googleapis.com is enabled...
✔  artifactregistry: required API artifactregistry.googleapis.com is enabled
✔  functions: required API cloudfunctions.googleapis.com is enabled
✔  functions: required API cloudbuild.googleapis.com is enabled
i  functions: Loaded environment variables from .env.
i  functions: preparing functions directory for uploading...
i  functions: packaged /Users/cchen/Code/OSS/nuxt3-firebase/web/functions (162.23 KB) for uploading
i  functions: preparing .firebase/nuxt3-firebase-fn-2/functions directory for uploading...
i  functions: packaged /Users/cchen/Code/OSS/nuxt3-firebase/web/.firebase/nuxt3-firebase-fn-2/functions (660.41 KB) for uploading
i  functions: ensuring required API run.googleapis.com is enabled...
i  functions: ensuring required API eventarc.googleapis.com is enabled...
i  functions: ensuring required API pubsub.googleapis.com is enabled...
i  functions: ensuring required API storage.googleapis.com is enabled...
✔  functions: required API run.googleapis.com is enabled
✔  functions: required API pubsub.googleapis.com is enabled
✔  functions: required API eventarc.googleapis.com is enabled
✔  functions: required API storage.googleapis.com is enabled
i  functions: generating the service identity for pubsub.googleapis.com...
i  functions: generating the service identity for eventarc.googleapis.com...
✔  functions: .firebase/nuxt3-firebase-fn-2/functions folder uploaded successfully
i  hosting[nuxt3-firebase-fn-2]: beginning deploy...
i  hosting[nuxt3-firebase-fn-2]: found 12 files in .firebase/nuxt3-firebase-fn-2/hosting
✔  hosting[nuxt3-firebase-fn-2]: file upload complete
i  functions: Skipping the deploy of unchanged functions with experimental support for skipdeployingnoopfunctions
✔  functions[helloWorld(us-central1)] Skipped (No changes detected)
i  functions: updating Node.js 16 (2nd Gen) function firebase-frameworks-nuxt3-firebase-fn-2:ssrnuxt3firebasefn2(us-central1)...
Build failed with status: FAILURE and message: ....js'
npm WARN tar TAR_ENTRY_ERROR ENOENT: no such file or directory, open '/workspace/node_modules/nitro-output/node_modules/source-map-js/lib/quick-sort.js'
npm WARN tar TAR_ENTRY_ERROR ENOENT: no such file or directory, open '/workspace/node_modules/nitro-output/node_modules/source-map-js/lib/mapping-list.js'
npm WARN tar TAR_ENTRY_ERROR ENOENT: no such file or directory, open '/workspace/node_modules/nitro-output/node_modules/source-map-js/lib/quick-sort.js'
npm WARN tar TAR_ENTRY_ERROR ENOENT: no such file or directory, open '/workspace/node_modules/nitro-output/node_modules/source-map-js/lib/source-map-consumer.js'
npm WARN tar TAR_ENTRY_ERROR ENOENT: no such file or directory, open '/workspace/node_modules/nitro-output/node_modules/source-map-js/lib/source-map-generator.js'
npm WARN tar TAR_ENTRY_ERROR ENOENT: no such file or directory, open '/workspace/node_modules/nitro-output/node_modules/source-map-js/lib/source-node.js'
npm WARN tar TAR_ENTRY_ERROR ENOENT: no such file or directory, open '/workspace/node_modules/nitro-output/node_modules/@vue/devtools-api/lib/cjs/api/util.js'
npm WARN tar TAR_ENTRY_ERROR ENOENT: no such file or directory, open '/workspace/node_modules/nitro-output/node_modules/source-map-js/lib/util.js'
npm WARN tar TAR_ENTRY_ERROR ENOENT: no such file or directory, open '/workspace/node_modules/nitro-output/node_modules/source-map-js/lib/source-map-consumer.js'
npm WARN tar TAR_ENTRY_ERROR ENOENT: no such file or directory, open '/workspace/node_modules/nitro-output/node_modules/source-map-js/lib/source-map-generator.js'
npm WARN tar TAR_ENTRY_ERROR ENOENT: no such file or directory, open '/workspace/node_modules/nitro-output/node_modules/source-map-js/lib/source-node.js'
npm WARN tar TAR_ENTRY_ERROR ENOENT: no such file or directory, open '/workspace/node_modules/nitro-output/node_modules/@vue/devtools-api/lib/cjs/api/util.js'
npm WARN tar TAR_ENTRY_ERROR ENOENT: no such file or directory, open '/workspace/node_modules/nitro-output/node_modules/source-map-js/lib/util.js'
npm WARN tar TAR_ENTRY_ERROR ENOENT: no such file or directory, open '/workspace/node_modules/nitro-output/node_modules/source-map/lib/util.js'
npm WARN tar TAR_ENTRY_ERROR ENOENT: no such file or directory, open '/workspace/node_modules/nitro-output/node_modules/source-map/package.json'
npm WARN tar TAR_ENTRY_ERROR ENOENT: no such file or directory, open '/workspace/node_modules/nitro-output/node_modules/source-map/package.json'
npm ERR! code EINTEGRITY
npm ERR! sha512-+t1FbVRm+BhU6maUuibt9qllRHbu+ejCT4pcHhOwIf++vKFIaApT36R2Bl6MolI1W3E5gCxefJ4eE61xdcJdbw== integrity checksum failed when using sha512: wanted sha512-+t1FbVRm+BhU6maUuibt9qllRHbu+ejCT4pcHhOwIf++vKFIaApT36R2Bl6MolI1W3E5gCxefJ4eE61xdcJdbw== but got sha512-4xZuVCUPIH2ddVjyo2EnyFDN8iCRvuDLvdGhl0Fu+1NQrZXFdvjQZ8ZtdLr8lg1w2xxrwQQs96g7/uVyLs3/TA==. (605756 bytes)

npm ERR! A complete log of this run can be found in:
npm ERR!     /www-data-home/.npm/_logs/2023-06-16T02_29_41_464Z-debug-0.log. For more details see the logs at https://console.cloud.google.com/cloud-build/builds;region=us-central1/b070d413-c7bf-4a58-b93c-910500b8d4fc?project=561721135419.

Functions deploy had errors with the following functions:
        firebase-frameworks-nuxt3-firebase-fn-2:ssrnuxt3firebasefn2(us-central1)
i  functions: cleaning up build files...

Error: There was an error deploying functions

I have reproduced this in two separate projects now (main project and then created the minimum reproduction sample).

Full debug log attached

firebase-debug.log

cloudbuild-logs-20230615-223919.json.txt

cloudbuild-logs-20230615-225120.csv

Activity

  1. vincekruger commented on Jul 3, 2023

    @vincekruger

    I had the same problem. I created this script in my package.json

    "firebase:deploy:hosting": "rm -fr .firebase && firebase deploy"

  2. CharlieDigital commented on Jul 3, 2023

    @CharlieDigital
    Author

    Ha; I love the simplicity and ingenuity here 🤣

  3. vincekruger commented on Jul 3, 2023

    @vincekruger

    If it's work, it works 😛

    This feature is still experimental.

  4. 9kubczas4 commented on Jan 10, 2024

    @9kubczas4
    Contributor

    Hey @CharlieDigital, thanks for reaching out. I’m unable to reproduce the issue you mentioned. I tried deploying the prepared repository multiple times, and it worked without any issues.
    Could you let us know if the issue still exists on your side?

  5. added
    Needs: Author Feedback
    on Jan 10, 2024
  6. CharlieDigital commented on Jan 10, 2024

    @CharlieDigital
    Author

    Will try when I have time; but hopefully it's been fixed :)

  7. added and removed
    Needs: Author Feedback
    on Jan 10, 2024
  8. added
    Needs: Author Feedback
    and removed on Jun 4, 2024
  9. google-oss-bot commented on Jun 5, 2024

    @google-oss-bot
    Collaborator

    Hey @CharlieDigital. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.

    If you have more information that will help us get to the bottom of this, just add a comment!

  10. google-oss-bot commented on Jun 10, 2024

    @google-oss-bot
    Collaborator

    Since there haven't been any recent updates here, I am going to close this issue.

    @CharlieDigital if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions