Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing 'default' export in 'module node_modules/node-domexception/index.js' #428

Closed
LouiFi opened this issue Feb 10, 2024 · 3 comments
Closed

Comments

@LouiFi
Copy link

LouiFi commented Feb 10, 2024

Hi,

I was just trying to perform the json example :

index.ts

import { createHelia } from 'helia'
import { json } from '@helia/json'

const helia = await createHelia()
const j = json(helia)

const myImmutableAddress = await j.add({ hello: 'world' })

console.log(await j.get(myImmutableAddress))

bun add @helia/json
bun run index.ts

1 | (function (entry, fetcher)
                        ^
SyntaxError: Missing 'default' export in module '/Users/username/project-folder/node_modules/node-domexception/index.js'.
      at link (:1:21)
      at link (:1:21)
      at link (:1:21)
      at link (:1:21)
      at link (:1:21)
      at link (:1:21)
      at link (:1:21)
      at link (:1:21)
      at link (:1:21)
      at linkAndEvaluateModule (:1:21)

When using node v20.11.0 (npm v10.2.4)

It's seems the certificate has expired when 'npm i helia'

npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/helia failed, reason: certificate has expired

npm ERR! A complete log of this run can be found in: /Users/louis_dauvergne/.npm/_logs/2024-02-10T18_47_32_186Z-debug-0.log

Is this something wrong with bun, certificate or node-domexception package ?

Thanks for helping

@achingbrain
Copy link
Member

npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/helia failed, reason: certificate has expired

This is the certificate of the registry at https://registry.npm.taobao.org - this is not the default registry which is https://registry.npmjs.org so you've overridden it in your config at some point.

Please can you try with the default registry.

SyntaxError: Missing 'default' export in module`

What happens when you run this with the latest node and not bun?

@LouiFi
Copy link
Author

LouiFi commented Feb 12, 2024

Thank you it's working like a charm with node --lts (without bun 😢 🐇)

I did not expect any PR related to bun so I will go back with tsc so !

@LouiFi LouiFi closed this as completed Feb 12, 2024
@achingbrain
Copy link
Member

There's a work-in-progress example PR for running with bun - we're waiting for a few dependencies to update, notably bun itself to support Windows.

Keep an eye on this, it should start working soon - ipfs-examples/helia-examples#101

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants