SyntaxError: Named export 'SimplePool' not found. The requested module 'nostr-tools' is a CommonJS module, which may not support all module.exports as named exports.
注: 1.6.0 で修正された。
1
import { SimplePool } from"nostr-tools";
以下のエラーが発生する。
1 2 3 4 5 6 7
import { SimplePool } from "nostr-tools"; ^^^^^^^^^^ SyntaxError: Named export 'SimplePool' not found. The requested module 'nostr-tools' 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 'nostr-tools'; const { SimplePool } = pkg;
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "undefined".] { code: 'ERR_UNHANDLED_REJECTION' }
未解決。暫定的に、エラーを引き起こすリレー サーバーを削除する。
pool.publish で wss://xxxx not connected
1 2
const pool = newSimplePool(); pool.publish(RELAYS, event);