Langgraph server doesn't work well with some typesript configurations #192

Closed
opened 2026-02-15 17:17:06 -05:00 by yindo · 2 comments
Owner

Originally created by @itachiRedhair on GitHub (Mar 6, 2025).

In my project built using NestJS, we have some code that imports moment like this:

import * as moment from 'moment'

When I try to use the langgraph server importing a graph, and this graph has further dependency on the existing code as above, it throws following error:

TypeError: moment is not a function

Is there any recommendation on how to make langgraph server and our nest server code work with the same code? This is just one example, it fails with many other imports that are like this.

Also, is there a way to use langgraph api server with an existing expressjs or nest server. It would be nice to import the langgraph routes and make it part of existing express based server.

Originally created by @itachiRedhair on GitHub (Mar 6, 2025). In my project built using NestJS, we have some code that imports moment like this: ``` import * as moment from 'moment' ``` When I try to use the langgraph server importing a graph, and this graph has further dependency on the existing code as above, it throws following error: ``` TypeError: moment is not a function ``` Is there any recommendation on how to make langgraph server and our nest server code work with the same code? This is just one example, it fails with many other imports that are like this. Also, is there a way to use langgraph api server with an existing expressjs or nest server. It would be nice to import the langgraph routes and make it part of existing express based server.
yindo added the docs-neededplatform labels 2026-02-15 17:17:06 -05:00
yindo closed this issue 2026-02-15 17:17:06 -05:00
Author
Owner

@benjamincburns commented on GitHub (Apr 28, 2025):

Hi @itachiRedhair - thanks for reporting this. Would it be possible for you to share a Minimal Reproducible Example that demonstrates the issue that you're encountering? Without the specific configuration details it will be very challenging for us to address this.

Can you also please confirm if this is still an issue with the latest version of LangGraph server?

cc @dqbd as FYI

@benjamincburns commented on GitHub (Apr 28, 2025): Hi @itachiRedhair - thanks for reporting this. Would it be possible for you to share a [Minimal Reproducible Example](https://en.wikipedia.org/wiki/Minimal_reproducible_example) that demonstrates the issue that you're encountering? Without the specific configuration details it will be very challenging for us to address this. Can you also please confirm if this is still an issue with the latest version of LangGraph server? cc @dqbd as FYI
Author
Owner

@dqbd commented on GitHub (May 19, 2025):

Hello! @itachiRedhair I believe this error might depend on the project structure and/or package manager of choice.

  • One possible hint might be the location of langgraph.json relative to the project. The langgraph.json file should be at the same place as package.json.
  • Another possible issue might be relying on implicit peer dependency + PNPM, which does not expose those dependencies unless explicitly defined in your package.json

Will close the issue now, feel free to reopen with a minimal reproducible example!

@dqbd commented on GitHub (May 19, 2025): Hello! @itachiRedhair I believe this error might depend on the project structure and/or package manager of choice. - One possible hint might be the location of `langgraph.json` relative to the project. The `langgraph.json` file should be at the same place as `package.json`. - Another possible issue might be relying on implicit peer dependency + PNPM, which does not expose those dependencies unless explicitly defined in your `package.json` Will close the issue now, feel free to reopen with a minimal reproducible example!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#192