Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

The requested module is a CommonJS module, which may not support all module.exports as named exports.

オープン
#52 コメント 9 件 リアクション 10 件 担当者 1 名 GitHub で見る

@davideast がすでに取り組んでいます。

2023年7月11日 から。

  • #67 @konstantinblaesi による — マージされずにクローズ

評価

この issue はまだ評価されていません。

説明

I have trouble using rxfire with SvelteKit using adapter-static. When running in dev mode I don't have any issue but when building my app I go troubles...

First, I import the auth package like that : import { authState } from "rxfire/auth";.
Which gaves me:

import { authState } from "rxfire/auth";
         ^^^^^^^^^
SyntaxError: Named export 'authState' not found. The requested module 'rxfire/auth' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'rxfire/auth';
const { authState } = pkg;

So, I did import * as rxfireauth from "rxfire/auth"; const { authState } = rxfireauth; and...
I got this now:

(node:88773) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
/Users/scorsi/projects/calicut/front/node_modules/rxfire/auth/index.esm.js:1
import { onAuthStateChanged, onIdTokenChanged, getIdToken } from 'firebase/auth';
^^^^^^

SyntaxError: Cannot use import statement outside a module...

The version installed :

  • firebase: 9.6.6
  • rxfire: 6.0.3

This may be related to #48 but I don't technically use SSR at all :)

Temporary workaround: disabling page prerendering in svelte.config.js (but I lose all interests of using SvelteKit lol):

kit: {
  adapter: adapter({fallback: "index.html"}),
  prerender: {
    enabled: false
  },
},

I can create a repro project next week if needed.

主要言語
TypeScript
スター
150
フォーク
50
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

FirebaseExtended/rxfire のほかの issue

FirebaseExtended/rxfire の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。