Skip to content

Inngest 3.44.1 upgrade blocked by browser bundling issues #1161

@bdougie

Description

@bdougie

Problem

Attempting to upgrade from [email protected] to [email protected] causes runtime errors in browser builds due to Node.js-specific module dependencies.

Error

TypeError: Failed to resolve module specifier "inngest". 
Relative references must start with either "/", "./", or "../".

Root Cause

Inngest 3.44+ uses Node.js-specific APIs (createRequire from node:module) that cannot be bundled for browser environments. Even with Vite alias configuration redirecting to a browser stub, the bundled output still contains bare module specifiers like import 'inngest' which browsers cannot resolve.

Approaches Tried (PR #1156)

  1. Vite externalization - Marked inngest as external in rollupOptions
  2. Client-safe wrapper - Refactored browser code to use API endpoints
  3. Vite alias to browser stub - Redirected inngest imports to browser stub during build
  4. Export matching - Added Inngest and NonRetriableError exports to stub

Result: Build succeeds, but runtime fails with module specifier error.

Investigation Needed

The bundler is still producing output with bare 'inngest' imports despite the alias. This suggests:

  1. Dynamic imports may be bypassing the alias
  2. Some code path is importing inngest at runtime rather than build time
  3. The alias isn't being applied to all module resolution contexts

Requirements for Success

  • Node.js 20+ (upgraded from 14+)
  • TypeScript 5.8+ (upgraded from 4.7+)
  • Zod 4.x (upgraded from 3.22.x)

Recommended Next Steps

  1. Investigate which code path produces the bare 'inngest' import in bundled output
  2. Consider conditional exports or import maps as alternative approaches
  3. Contact Inngest team about browser compatibility strategy for v3.44+
  4. Evaluate if delaying upgrade until better solution exists

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPackage dependencies and dependency updates

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions