Skip to content

Cannot find module 'bun' in Tanstack monorepo #7079

@DeckardGer

Description

@DeckardGer

Which project does this relate to?

Router

Describe the bug

I can't import any bun libraries like s3, redis, hashing/crypto, etc in my Tanstack monorepo project. I get the error: "Cannot find module 'bun'". I have tested both in server action files, as well as a s3 package which gets imported into the web project.

Your Example Website or App

https://github.com/DeckardGer/bun-tanstack-test

Steps to Reproduce the Bug or Issue

  1. bun install
  2. bun run dev
  3. Navigate to localhost:3001/api/bun-test
  4. Look in server logs for error

Expected behavior

I should be receiving a hash created using the hash library from bun

Screenshots or Videos

Image

Platform

  • Router / Start Version: 1.141.1
  • OS: MacOS
  • Browser: Arc
  • Browser Version: 1.140.0
  • Bundler: Vite
  • Bundler Version: 7.0.2

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions