🚨 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

Hey @higinio_maycotte

Thanks for the detailed breakdown.

I just did a Nextjs Codegen of your project locally and it’s working fine with the same package versions as you mentioned

"@plasmicapp/cli": "^0.1.342",
"@plasmicapp/react-web": "^0.2.398",

and it shows the respective _useStyleTokens imports as follows

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

Could you please confirm if you could still reproduce this issue?

Thanks

Thanks for taking a look. I just tried a publish moments ago and still getting the same errors in Vercel. Locally too. When I move back to a commit prior to 2 days ago I am able to get the project to build. This seems to have happened right after these commits:

Don’t know if this helps, but here is the build log from Vercel:

[18:10:25.948] Running build in Washington, D.C., USA (East) – iad1
[18:10:25.949] Build machine configuration: 4 cores, 8 GB
[18:10:25.961] Cloning github.com/ownerco-dev/ownerco-website (Branch: preview, Commit: a008fe5)
[18:10:27.572] Cloning completed: 1.611s
[18:10:29.040] Restored build cache from previous deployment (3mC5BeKYqt7xAC2re8fmFkfLzBG8)
[18:10:34.806] Running "vercel build"
[18:10:35.248] Vercel CLI 45.0.10
[18:10:35.960] Installing dependencies...
[18:10:39.318] 
[18:10:39.318] added 9 packages, and changed 46 packages in 3s
[18:10:39.318] 
[18:10:39.319] 147 packages are looking for funding
[18:10:39.319]   run `npm fund` for details
[18:10:39.354] Detected Next.js version: 14.2.28
[18:10:39.360] Running "npm run build"
[18:10:39.528] 
[18:10:39.528] > tmp-cpa@0.1.0 build
[18:10:39.528] > next build
[18:10:39.528] 
[18:10:40.274]   â–˛ Next.js 14.2.28
[18:10:40.274] 
[18:10:40.274]    Skipping linting
[18:10:40.274]    Checking validity of types ...
[18:11:20.281]    Creating an optimized production build ...
[18:11:28.616] âś… PageManifestPlugin: Generated static-pages.data.js with 40 static pages
[18:11:32.941] Failed to compile.
[18:11:32.941] 
[18:11:32.941] ./components/plasmic/owner_co_website/PlasmicAaaElements.tsx
[18:11:32.941] Module not found: Empty dependency (no request)
[18:11:32.941] 
[18:11:32.942] https://nextjs.org/docs/messages/module-not-found
[18:11:32.942] 
[18:11:32.942] Import trace for requested module:
[18:11:32.942] ./pages/dev-elements.tsx
[18:11:32.942] 
[18:11:32.942] ./components/plasmic/owner_co_website/PlasmicAccess.tsx
[18:11:32.942] Module not found: Empty dependency (no request)
[18:11:32.942] 
[18:11:32.942] https://nextjs.org/docs/messages/module-not-found
[18:11:32.942] 
[18:11:32.942] Import trace for requested module:
[18:11:32.942] ./pages/access.tsx
[18:11:32.942] 
[18:11:32.942] ./components/plasmic/owner_co_website/PlasmicBorrow.tsx
[18:11:32.942] Module not found: Empty dependency (no request)
[18:11:32.942] 
[18:11:32.942] https://nextjs.org/docs/messages/module-not-found
[18:11:32.942] 
[18:11:32.943] Import trace for requested module:
[18:11:32.943] ./pages/borrow.tsx
[18:11:32.943] 
[18:11:32.943] ./components/plasmic/owner_co_website/PlasmicBorrowApplication.tsx
[18:11:32.943] Module not found: Empty dependency (no request)
[18:11:32.943] 
[18:11:32.943] https://nextjs.org/docs/messages/module-not-found
[18:11:32.943] 
[18:11:32.943] Import trace for requested module:
[18:11:32.943] ./pages/borrow/apply.tsx
[18:11:32.943] 
[18:11:32.943] ./components/plasmic/owner_co_website/PlasmicBorrowEligibility.tsx
[18:11:32.943] Module not found: Empty dependency (no request)
[18:11:32.943] 
[18:11:32.943] https://nextjs.org/docs/messages/module-not-found
[18:11:32.943] 
[18:11:32.943] Import trace for requested module:
[18:11:32.944] ./pages/borrow/eligibility.tsx
[18:11:32.944] 
[18:11:32.944] 
[18:11:32.944] > Build failed because of webpack errors
[18:11:32.995] Error: Command "npm run build" exited with 1

I checked all my other pages and they all have the same broken imports, Vercel just exited after the first 5.

Thanks!

I looked into it a bit further and I think I found the key difference:

Your working import:

import { useStyleTokens as useStyleTokens_antd_5_hostless } from "../antd_5_hostless/PlasmicStyleTokensProvider";

My broken import:

import { useStyleTokens as useStyleTokens_antd_5_hostless } from "";

The Issue: I’m missing the PlasmicStyleTokensProvider.tsx file in my antd_5_hostless folder. My folder only contains:

  • PlasmicGlobalContextsProvider.tsx
  • plasmic.module.css

But NOT PlasmicStyleTokensProvider.tsx which your working version is trying to import from.

My plasmic.json shows:

"styleTokensProviderFilePath": "",

for the antd_5_hostless project (ohDidvG9XsCeFumugENU3J).

Questions:

  1. Does your test project have PlasmicStyleTokensProvider.tsx?
  2. Is the codegen supposed to create this file automatically?
  3. Could this be a sync issue where the file creation failed but the import generation succeeded?

This might explain the discrepancy - your test has the required file, but my project sync didn’t create it properly.

Thanks for investigating!

A few more details that might help your investigation… I tried running npx @plasmicapp/cli sync (upgraded CLI to 0.1.342) and while it completed successfully with “Fixing import statements…” message, it did not fix the core issue.

What the sync did:

  • :white_check_mark: Updated some SignIn/SignUp components
  • :white_check_mark: Updated CLI and package versions
  • :cross_mark: Did NOT create PlasmicStyleTokensProvider.tsx
  • :cross_mark: Did NOT fix the empty import statements

The broken imports remain unchanged:

import { _useStyleTokens as useStyleTokens_antd_5_hostless } from ""; // still empty

Your working version should have:

import { _useStyleTokens as useStyleTokens_antd_5_hostless } from "../antd_5_hostless/PlasmicStyleTokensProvider";

The Issue: I’m missing the PlasmicStyleTokensProvider.tsx file in my antd_5_hostless folder. My folder only contains:

  • PlasmicGlobalContextsProvider.tsx
  • plasmic.module.css

But NOT PlasmicStyleTokensProvider.tsx which your working version is trying to import from.

My plasmic.json shows:

"styleTokensProviderFilePath": "",

for the antd_5_hostless project (ohDidvG9XsCeFumugENU3J).

Remaining Questions:

  1. Does your test project have PlasmicStyleTokensProvider.tsx?
  2. Is the codegen supposed to create this file automatically?
  3. Could this be a sync issue where the file creation failed but the import generation succeeded?

I think this confirms that the issue is the missing PlasmicStyleTokensProvider.tsx file in the antd_5_hostless folder. The sync is not generating this file for some reason, but your test environment has it.

Hi @muhammad_asim

I ran into the same problem after project synchronization:



"@plasmicapp/cli": "^0.1.342"
"@plasmicapp/react-web": "^0.2.398"

I’ve also run into the same problem as above - showing "styleTokensProviderFilePath": "" in my plasmic.json after a plasmic sync, and causing build errors for the empty dependency.

I’m also having this issue as well. It asks me to update plasmic cli and react-web and then breaks the imports

I am experiencing the same issue as well.

Thank you for reporting this issue. We are actively investigating it. In the mean time, can you try syncing with the --force flag?

4 Likes

Thanks for the suggestion, the --force sync solved the problem by completely regenerating the corrupted Style Tokens codegen.

Issue: 37+ component files had broken imports like import { useStyleTokens_antd_5_hostless } from "" causing “Module not found: Empty dependency” build failures.

Solution: npx @plasmicapp/cli sync --force

Results:

  • All broken import statements fixed
  • Build completes with zero errors
  • Package dependencies updated automatically
  • Missing PlasmicStyleTokensProvider.tsx files regenerated
  • All tests are passing

Regular sync didn’t work, but --force completely rebuilt the Style Tokens integration and resolved everything. Also updated @plasmicapp/host to 1.0.224 to eliminate version warnings. You may still have some work to do your end but I am all set, THANKS!

2 Likes