#1188·plasmo

[BUG] Error: Could not resolve module "node:module" in jiti after upgrading to Tailwind v4 in Plasmo

Author: peguimasidCreated Feb 12, 2025Updated Jul 7, 2026
Labelsbug

Description

After upgrading to Tailwind v4 using npx @tailwindcss/upgrade@next, the Plasmo build fails with the following error:

 ERROR | Build failed. To debug, run plasmo dev --verbose.
 ERROR | Could not resolve module "node:module" from "/Users/guilhermomasid/Documents/trash/plasmo-tailwind/node_modules/.pnpm/[email protected]/node_modules/jiti/lib/jiti.cjs"

Steps to Reproduce

  1. Create a new Plasmo extension with TailwindCSS using:
bash
pnpm create plasmo --with-tailwindcss  
  1. Upgrade Tailwind to v4 using:
bash
npx @tailwindcss/upgrade@next 
  1. Run the Plasmo dev server:
bash
pnpm dev  
  1. The build fails with the above error.

Repository

I have created a repository to reproduce the issue: plasmo-tailwind-v4-bug

  • The main branch contains the unmodified Plasmo Tailwind example.
  • The feat/tailwind-v4 branch contains the project after the Tailwind v4 upgrade.
  • A pull request comparing the changes is available here: PR #1.

Expected Behavior

The project should build successfully after upgrading to Tailwind v4.

Actual Behavior

The build fails with a module resolution error related to [email protected].

Environment

  • TailwindCSS v4
  • Jiti v2.4.2
  • Node.js version: v22.13.1
  • Package manager: pnpm

Additional Notes

This issue seems related to [email protected] and its inability to resolve the node:module package. Any insights or workarounds would be greatly appreciated.

Version

Latest

What OS are you seeing the problem on?

MacOSX

What browsers are you seeing the problem on?

Chrome

Relevant log output

bash
p dev

> [email protected] dev /Users/guilhermomasid/Documents/trash/plasmo-tailwind
> plasmo dev

 Plasmo v0.90.2
 The Browser Extension Framework
 INFO   | Starting the extension development server...
 INFO   | Building for target: chrome-mv3
 INFO   | Loaded environment variables from: []
(node:59554) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
 ERROR  | Build failed. To debug, run plasmo dev --verbose.
 ERROR  | Could not resolve module "node:module" from "/Users/guilhermomasid/Documents/trash/plasmo-tailwind/node\_modules/.pnpm/[email protected]/node\_modules/jiti/lib/jiti.cjs"

(OPTIONAL) Contribution

  • I would like to fix this BUG via a PR

Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I checked the current issues for duplicate problems.