Skip to content

Appkit template uses getRequestContext which doesn't exist in @databricks/appkit #4339

@keugenek

Description

@keugenek

Summary

The appkit template in experimental/aitools/templates/appkit/ imports getRequestContext from @databricks/appkit, but this function does not exist in any published version of the package (checked 0.1.1 through 0.1.5).

Reproduction

Apps generated using the MCP server with the appkit template fail at runtime with:

file:///tmp/.../dist/server/trpc.js:4
import { getRequestContext } from '@databricks/appkit';
         ^^^^^^^^^^^^^^^^^
SyntaxError: Named export 'getRequestContext' not found. The requested module '@databricks/appkit' is a CommonJS module...

Affected File

experimental/aitools/templates/appkit/template/{{.project_name}}/server/trpc.ts:

import { getRequestContext } from '@databricks/appkit';
// ...
const { serviceDatabricksClient: client } = getRequestContext();

Current @databricks/appkit exports (v0.1.5)

export { CacheManager, Plugin, SeverityNumber, SpanStatusCode, 
         analytics, appKitTypesPlugin, createApp, isSQLTypeMarker, 
         server, sql, toPlugin };

No getRequestContext export exists.

Suggested Fix

Either:

  1. Add getRequestContext to the @databricks/appkit package
  2. Update the template to use the existing appkit APIs
  3. If this is an internal/unpublished feature, document the required appkit version or provide a workaround

Environment

  • CLI version: snapshot (main branch)
  • @databricks/appkit: all versions 0.1.1-0.1.5 tested
  • Platform: Databricks Runtime 16.2.x

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