[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
- Create a new Plasmo extension with TailwindCSS using:
pnpm create plasmo --with-tailwindcss - Upgrade Tailwind to v4 using:
npx @tailwindcss/upgrade@next - Run the Plasmo dev server:
pnpm dev - The build fails with the above error.
Repository
I have created a repository to reproduce the issue: plasmo-tailwind-v4-bug
- The
mainbranch contains the unmodified Plasmo Tailwind example. - The
feat/tailwind-v4branch 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
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.
Source: PlasmoHQ/plasmo