ipfs-examples / js-ipfs-examples

Collection of js-ipfs examples
246 stars 157 forks source link

next js example does not work #266

Open AtlasPilotPuppy opened 2 years ago

AtlasPilotPuppy commented 2 years ago

It throws an in initialization

Unhandled Runtime Error
TypeError: PubsubRouter is not a constructor

Call Stack
pubsubAdapter
node_modules/libp2p/src/pubsub-adapter.js (17:0)
new Libp2p
node_modules/libp2p/src/index.js (334:0)
Function.create
node_modules/libp2p/src/index.js (142:0)
createLibp2p
node_modules/ipfs-core/esm/src/components/libp2p.js (35:9)
configureRepo
node_modules/ipfs-core/esm/src/components/storage.js (137:35)
async loadRepo
node_modules/ipfs-core/esm/src/components/storage.js (51:0)
async Function.start
node_modules/ipfs-core/esm/src/components/storage.js (37:36)
async create
node_modules/ipfs-core/esm/src/components/index.js (275:0)
mingderwang commented 2 years ago

We have to same error.

cppshane commented 2 years ago

Same issue on the Angular example.

danielfalbo commented 2 years ago

I can't compile it either, but I get a different error:

> example-browser-nextjs@1.0.0 build
> next build && next export -o dist

info  - Checking validity of types...
info  - Creating an optimized production build...
info  - Compiled successfully
info  - Collecting page data...

> Build error occurred
TypeError: Class extends value undefined is not a constructor or null
at Object.<anonymous> (/vercel/path0/node_modules/timeout-abort-controller/index.js:8:33)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at ModuleWrap.<anonymous> (internal/modules/esm/translators.js:199:29)
at ModuleJob.run (internal/modules/esm/module_job.js:183:25)
at async Loader.import (internal/modules/esm/loader.js:178:24) {
type: 'TypeError'
Error: Command "npm run build" exited with 1

Looks like this happens when one circularly imports classes

I spent a lot of time on this but couldn't get it to work, I need help. Thank you :)

danielfalbo commented 2 years ago

Forgot a very important detail: no issues compiling locally on my machine, only get the error on the Vercel deployment

stoplion commented 2 years ago

Same error