🚨 CRITICAL: Empty import statements breaking builds after Style Tokens feature rollout

Summary

After today’s Plasmic Studio update (Aug 15, 2025), codegen is generating malformed import statements with empty module paths, causing complete build failures for projects using external Plasmic dependencies. Confirmed on both local builds and Vercel production builds - this is not an environment-specific issue.

Error

Module not found: Empty dependency (no request)
https://nextjs.org/docs/messages/module-not-found

Affected Code

Generated files contain broken imports like:

import { _useStyleTokens as useStyleTokens_antd_5_hostless } from ""; // plasmic-import: ohDidvG9XsCeFumugENU3J/styleTokensProvider

Environment

  • Date: August 15, 2025
  • Plasmic Packages Updated:
    • @plasmicapp/react-web: 0.2.381 → 0.2.398
    • @plasmicapp/cli: 0.1.341 → 0.1.342
  • Framework: Next.js 14.2.28
  • Language: TypeScript
  • Tested On: :white_check_mark: Local development build, :white_check_mark: Vercel production build

Project Details

  • Main Project ID: mHePzBFze6PJcjfERHFGjK (OwnerCo Website)
  • Affected Dependency: ohDidvG9XsCeFumugENU3J (antd5 hostless)
  • Plasmic.json shows: "styleTokensProviderFilePath": "" for antd5 hostless

Root Cause Analysis

What Changed

The new Style Tokens feature replaced CSS module imports with hook-based imports:

Before (working):

import plasmic_antd_5_hostless_css from "../antd_5_hostless/plasmic.module.css";
// Usage: plasmic_antd_5_hostless_css.plasmic_tokens

After (broken):

import { _useStyleTokens as useStyleTokens_antd_5_hostless } from ""; // ❌ Empty path
// Usage: useStyleTokens_antd_5_hostless()

The Bug

  1. :white_check_mark: Plasmic correctly identifies that antd5 hostless has no StyleTokensProvider
  2. :white_check_mark: Sets "styleTokensProviderFilePath": "" in plasmic.json
  3. :cross_mark: But still generates import statement with empty path
  4. :cross_mark: Should either create the missing file OR skip the import

Affected Files (some, there are many more)

  • PlasmicAaaElements.tsx (line 65)
  • PlasmicAccess.tsx (line 66)
  • PlasmicBorrow.tsx (line 69)
  • PlasmicBorrowApplication.tsx (line 68)
  • PlasmicBorrowEligibility.tsx (line 68)

Note: Build fails fast, but CONFIRMED that these are just the first 5 files in alphabetical order and I have 37 files total have the broken import.

Impact

  • :cross_mark: Complete build failure - no deployments possible
  • :globe_showing_europe_africa: Widespread: Affects any project using popular hostless dependencies
  • :alarm_clock: Immediate: Blocks all users who sync after ~21:22 UTC today
  • :fire: Severity: High Priority - Blocking deployments for affected projects

Expected Behavior

For dependencies without StyleTokensProvider, codegen should either:

  1. Skip the import entirely, OR
  2. Create a default StyleTokensProvider file for the dependency

Reproduction Steps

  1. Have a project using antd5 hostless or similar external dependency
  2. Sync with Plasmic Studio after Aug 15, 2025
  3. Run npm run build (local or production)
  4. Observe “Empty dependency” errors

Workaround Status

:cross_mark: No clean workaround available:

  • Can’t edit generated files (overwritten on sync)
  • Can’t remove dependency (breaks existing components)
  • Removing dependency would require major refactoring

Additional Context

  • This appears to be a systematic codegen bug introduced with Style Tokens rollout
  • Projects using popular hostless libraries likely affected
  • The feature works correctly for main projects (StyleTokensProvider created successfully)
  • Bug is specifically in dependency resolution logic
  • Affects both local and production builds - confirmed not environment-specific

Request

Please address this issue as it’s blocking deployments for projects using external Plasmic dependencies.


Commit showing the issue: 0e7ed24377bf0f615a3343a998ef3e71d8d87085
Studio URL: Plasmic