Skip to content

Bug Report: @keystar/ui dist/keystar-ui-layout.js self-import may cause useGridStyleProps is not a function with Next 16 Turbopack #1501

@bh2980

Description

@bh2980

Summary

Turbopack production build crashes at runtime with useGridStyleProps is not a function. Building with Webpack works for me.

Error

Uncaught TypeError: (0 , p.useGridStyleProps) is not a function  
at keystar-ui-layout.js:380:39

Steps

  1. Build with next build (Turbopack default in Next 16)
  2. Run next start and open the app (Keystatic admin page)
  3. The runtime crash happens

What works for me

Building with Webpack works: next build --webpack

Additional context

I noticed @keystar/ui@0.7.19's published dist file includes a self-import, which may be related to this issue:
https://cdn.jsdelivr.net/npm/@keystar/ui@0.7.19/dist/keystar-ui-layout.js

// node_modules/@keystar/ui/dist/keystar-ui-layout.js
import { useGridStyleProps as useGridStyleProps$1 } from './keystar-ui-layout.js';

// ... later in the file ...
function ScrollView(props) {
  // This fails because useGridStyleProps$1 is undefined due to the self-import
  let styleProps = useGridStyleProps$1(otherProps); 
}

//...

export { ..., useGridStyleProps, ... };

Versions

  • Next.js: 16.1.1
  • React: 19.2.3
  • @keystar/ui: 0.7.19
  • @keystatic/core: 0.5.48
  • pnpm

Question

I’m not sure if this self-import is intentional. If it isn’t, would it be possible to fix it in a future release?

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