Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 of 3 tasks
peguimasid opened this issue Feb 12, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@peguimasid
Copy link

peguimasid commented Feb 12, 2025

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:
pnpm create plasmo --with-tailwindcss  
  1. Upgrade Tailwind to v4 using:
npx @tailwindcss/upgrade@next 
  1. Run the Plasmo dev server:
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

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.
@peguimasid peguimasid added the bug Something isn't working label Feb 12, 2025
@thekayshawn
Copy link

+1 on this, got a monorepo setup with 4 apps using the same shared design system with tailwind v4, have to make the PR wait until this gets resolved otherwise our extension will break.

@Jemeni11
Copy link

Same here ✋

@BalutaAlex
Copy link
Contributor

BalutaAlex commented Feb 17, 2025

Probably related to parcel-bundler/parcel#9244. The issue has been fixed in newer parcel versions it seems so we should get forward with updating to a newer parcel version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants