简体   繁体   English

“@firebase/database-compat”中“./standalone”条目的已知条件 package

[英]No known conditions for "./standalone" entry in "@firebase/database-compat" package

When running npm run build on my sveltekit project, i get the following error generated by vite :在我的 sveltekit 项目上运行npm run build时,我收到vite生成的以下错误:

7:55:49 PM [vite-plugin-svelte] The following packages did not export their `package.json` file so we could not check the "svelte" field. If you had difficulties importing svelte components from a package, then please contact the author and ask them to export the package.json file.
- firebase-admin
✓ 47 modules transformed.
[commonjs] No known conditions for "./standalone" entry in "@firebase/database-compat" package
> No known conditions for "./standalone" entry in "@firebase/database-compat" package
Error: No known conditions for "./standalone" entry in "@firebase/database-compat" package
    at bail (/home/vincent/repos/sveltekit/node_modules/vite/dist/node/chunks/dep-e0fe87f8.js:29712:8)
    at resolve$1 (/home/vincent/repos/sveltekit/node_modules/vite/dist/node/chunks/dep-e0fe87f8.js:29768:32)
    at resolveExports (/home/vincent/repos/sveltekit/node_modules/vite/dist/node/chunks/dep-e0fe87f8.js:30285:12)
    at resolveDeepImport (/home/vincent/repos/sveltekit/node_modules/vite/dist/node/chunks/dep-e0fe87f8.js:30301:26)
    at tryNodeResolve (/home/vincent/repos/sveltekit/node_modules/vite/dist/node/chunks/dep-e0fe87f8.js:30043:11)
    at Object.resolveId (/home/vincent/repos/sveltekit/node_modules/vite/dist/node/chunks/dep-e0fe87f8.js:29910:28)
    at /home/vincent/repos/sveltekit/node_modules/rollup/dist/shared/rollup.js:22697:251

I checked in the node_modules and the package @firebase/database-compat actually exports his package.json.我检查了node_modules和 package @firebase/database-compat实际上导出了他的 package.json。 I'm really stuck here.我真的被困在这里了。

Here is my package.json :这是我的package.json

{
  "private": true,
  "type": "module",
  "scripts": {
    "dev": "svelte-kit dev",
    "build": "svelte-kit build --verbose",
    "preview": "svelte-kit preview"
  },
  "devDependencies": {
    "@sveltejs/adapter-vercel": "next",
    "@sveltejs/kit": "next",
    "@tsconfig/svelte": "^2.0.1",
    "@types/body-parser": "^1.19.1",
    "@types/cookie": "^0.4.1",
    "sass": "^1.39.2",
    "svelte": "^3.38.3",
    "typescript": "^4.4.3"
  },
  "dependencies": {
    "body-parser": "^1.19.0",
    "cookie": "^0.4.1",
    "firebase": "^9.4.1",
    "firebase-admin": "^10.0.0",
    "prettier": "^2.3.2",
    "prettier-plugin-svelte": "^2.3.1",
    "svelte-preprocess": "^4.9.4"
  },
  "prettier": {
    "arrowParens": "always",
    "singleQuote": true,
    "tabWidth": 2,
    "trailingComma": "none"
  }
}

did you find an answer ?你找到答案了吗? i'm having the same problem我有同样的问题

I had to change the import from CJS style to ESM style.我不得不将导入从 CJS 样式更改为 ESM 样式。

From: const { Pkg } = require('package/sub')来自: const { Pkg } = require('package/sub')

To: import { Pkg } from 'package/sub'到: import { Pkg } from 'package/sub'

Perhaps Vite just isn't able to resolve the way this package is exported and imported in this case?也许 Vite 无法解决这个 package 在这种情况下的导出和导入方式?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何检查 firebase 数据库中是否存在唯一条目? - How to check if unique entry exists in firebase database or not? Unity + Firebase - Unity.compat 冲突 - Unity + Firebase - Unity.compat collision 从 firebase 版本 8 升级到版本 9 compat - Service firestore 不可用 - Upgrading from firebase version 8 to version 9 compat - Service firestore is not available 初始化“@nuxtjs/firebase”模块时出现 Nuxt 致命错误 - 找不到模块“firebase/compat/app” - Nuxt FATAL error when initializing '@nuxtjs/firebase' module - Cannot find module 'firebase/compat/app' Angular 13:命名空间“/node_modules/firebase/compat/index”没有导出成员“用户”。 ts(2694) - Angular 13: Namespace '"/node_modules/firebase/compat/index"' has no exported member 'User'. ts(2694) 我的 firebase 项目中的 Auth-compat 'index.d.ts' 错误 - Auth-compat 'index.d.ts' error in my firebase project 如何使用请求模块向 firebase 添加条目? - How to add an entry to firebase using requests module? flutter 中的 firebase 条件过滤器列表 - Filter list by firebase conditions in flutter 检索带条件的 Firebase 数据? - Retrieving Firebase Data with Conditions? 如何为 firebase 存储中具有已知路径的图片获取可重用的 url? - How to get reusable url for a picture in firebase storage that has a known path?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM