TypeError: Class extends value undefined is not a constructor or null

$ node .mastra/output/index.mjs
file:///C:/Users/Ghassen/Documents/Coding/Projects/Junet.io/chat/apps/mastra/.mastra/output/mastra.mjs:227787
class Duplexify extends Duplex$4 {
^

TypeError: Class extends value undefined is not a constructor or null
at file:///C:/Users/Ghassen/Documents/Coding/Projects/Junet.io/chat/apps/mastra/.mastra/output/mastra.mjs:22
7787:25
at ModuleJob.run (node:internal/modules/esm/module_job:274:25)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:644:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5)

Node.js v22.16.0
$ node .mastra/output/index.mjs
file:///C:/Users/Ghassen/Documents/Coding/Projects/Junet.io/chat/apps/mastra/.mastra/output/mastra.mjs:227787
class Duplexify extends Duplex$4 {
^

TypeError: Class extends value undefined is not a constructor or null
at file:///C:/Users/Ghassen/Documents/Coding/Projects/Junet.io/chat/apps/mastra/.mastra/output/mastra.mjs:22
7787:25
at ModuleJob.run (node:internal/modules/esm/module_job:274:25)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:644:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5)

Node.js v22.16.0
4 Replies
Mastra Triager
GitHub
[DISCORD:1432566401608060969] TypeError: Class extends value undefi...
This issue was created from Discord post: https://discord.com/channels/1309558646228779139/1432566401608060969 $ node .mastra/output/index.mjs file:///C:/Users/Ghassen/Documents/Coding/Projects/Jun...
_roamin_
_roamin_3w ago
Hi @Ghassen ! Could you share a repro example with us? THanks 🙏
victor
victor2w ago
+1 @Romain, both node 22 and 20
file:///app/.mastra/output/mastra.mjs:288824 class Duplexify extends Duplex$4 { ^ TypeError: Class extends value undefined is not a constructor or null at file:///app/.mastra/output/mastra.mjs:288824:25 at ModuleJob.run (node:internal/modules/esm/module_job:325:25) at async ModuleLoader.import (node:internal/modules/esm/loader:606:24) at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5) Node.js v20.19.5
file:///app/.mastra/output/mastra.mjs:288824 class Duplexify extends Duplex$4 { ^ TypeError: Class extends value undefined is not a constructor or null at file:///app/.mastra/output/mastra.mjs:288824:25 at ModuleJob.run (node:internal/modules/esm/module_job:325:25) at async ModuleLoader.import (node:internal/modules/esm/loader:606:24) at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5) Node.js v20.19.5
Adding ioredis and ai to bundler.externals seems to have fixed the issue on node 22.
Ward
Ward2w ago
@Ghassen this should be fixed in latest version of mastra cli

Did you find this page helpful?