framework icon indicating copy to clipboard operation
framework copied to clipboard

Error on building with preset cloudflare with usage of firestore

Open zendagin opened this issue 3 years ago • 3 comments

Environment

Tested on Mac and Windows

Nuxt CLI v3.0.0-27356801.e9128f3 19:37:37 RootDir: /Users/user/group/project 19:37:40 Nuxt project info: 19:37:40


  • Operating System: Darwin
  • Node Version: v16.13.1
  • Nuxt Version: 3.0.0-27356801.e9128f3
  • Package Manager: [email protected]
  • Bundler: Vite
  • User Config: nitro, buildModules, windicss, css, privateRuntimeConfig
  • Runtime Modules: -
  • Build Modules: @vueuse/core/[email protected], [email protected]

======================================================

Nuxt CLI v3.0.0-27356801.e9128f3 20:37:14 RootDir: C:\Users\user\group\project 20:37:17 Nuxt project info: 20:37:17


  • Operating System: Windows_NT
  • Node Version: v14.17.5
  • Nuxt Version: 3.0.0-27356801.e9128f3
  • Package Manager: [email protected]
  • Bundler: Vite
  • User Config: nitro, buildModules, windicss, css, privateRuntimeConfig
  • Runtime Modules: -
  • Build Modules: @vueuse/[email protected], [email protected]

Reproduction

codesandbox corresponding git repo Need firebase service account credential in .env.

Describe the bug

Cannot build with config nitro: {preset: "cloudflare"} on a project using firestore in firebase-admin.

Additional context

nuxi dev works, the error only occurs when building output. It only occurs when using both, removing either one can build successfully.

I have also tried: Using preset lambda instead of cloudflare -> work Adding firebase auth usage and remove firestore usage -> work

So it seems that something go wrong with the cloudflare + firestore combination.

Logs

ERROR  Rollup error: Could not load /Users/user/group/project/node_modules/unenv/runtime/mock/proxy/.cjs (imported by node_modules/readable-stream/lib/_stream_readable.js): ENOENT: no such file or directory, open '/Users/user/group/project/node_modules/unenv/runtime/mock/proxy/.cjs'


 ERROR  Could not load /Users/user/group/project/node_modules/unenv/runtime/mock/proxy/.cjs (imported by node_modules/readable-stream/lib/_stream_readable.js): ENOENT: no such file or directory, open '/Users/user/group/project/node_modules/unenv/runtime/mock/proxy/.cjs'

zendagin avatar Jan 14 '22 11:01 zendagin

Confirmed with nuxt version 3.0.0-27404660.0f9bcbf too.

NachoBrito avatar Feb 10 '22 17:02 NachoBrito

I'm not using Firebase, but am also experiencing this error when building with NITRO_PRESET set to cloudflare:-

 ERROR  Rollup error: Could not load /Users/username/project/node_modules/unenv/runtime/mock/proxy/.cjs (imported by ../node_modules/readable-stream/lib/_stream_readable.js): ENOENT: no such file or directory, open '/Users/username/project/node_modules/unenv/runtime/mock/proxy/.cjs'


 ERROR  Could not load /Users/username/project/node_modules/unenv/runtime/mock/proxy/.cjs (imported by ../node_modules/readable-stream/lib/_stream_readable.js): ENOENT: no such file or directory, open '/Users/username/project/node_modules/unenv/runtime/mock/proxy/.cjs
{
  "name": "site",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "dev": "nuxi dev",
    "build": "nuxi build",
    "start": "node .output/server/index.mjs"
  },
  "devDependencies": {
    "@nuxtjs/sanity": "^1.1.1",
    "@nuxtjs/tailwindcss": "^5.0.0-4",
    "nuxt3": "^3.0.0-27458996.6342e82",
    "postcss-preset-env": "^7.4.1"
  },
  "dependencies": {
    "focus-visible": "^5.2.0"
  }
}

Any help would be greatly appreciated 👍

saulhardman avatar Mar 17 '22 18:03 saulhardman

I'm also experiencing this problem with a library called @sanity/client.

 ERROR  Rollup error: Could not load /nuxt-app/node_modules/unenv/runtime/mock/proxy-cjs/.cjs (imported by node_modules/readable-stream/lib/_stream_readable.js): ENOENT: no such file or directory, open '/nuxt-app/node_modules/unenv/runtime/mock/proxy-cjs/.cjs'


 ERROR  Could not load /nuxt-app/node_modules/unenv/runtime/mock/proxy-cjs/.cjs (imported by node_modules/readable-stream/lib/_stream_readable.js): ENOENT: no such file or directory, open '/nuxt-app/node_modules/unenv/runtime/mock/proxy-cjs/.cjs'

jvanst avatar Apr 14 '22 22:04 jvanst

This should be resolved in the latest version of nitropack, which you can get with yarn upgrade nuxt or npm upgrade nuxt.

Let me know if not and I'll reopen.

danielroe avatar Sep 12 '22 14:09 danielroe