-
-
Notifications
You must be signed in to change notification settings - Fork 56
Description
Description
When attempting to integrate Tailwind CSS 4 with a Bolt-CEP project, the build process fails with ESM-related errors.
Steps to Reproduce
- Create or use an existing Bolt-CEP project
- Install Tailwind CSS 4
- Attempt to run the development server
Error Details
node_modules/esbuild/lib/main.js:1373:27: ERROR: [plugin: externalize-deps] Failed to resolve "@tailwindcss/vite". This package is ESM only but it was tried to load by require. See http://vitejs.dev/guide/troubleshooting.html#this-package-is-esm-only for more details.
Environment
- Bolt-CEP version: Using vite-cep-plugin v1.1.12
- Node.js version: v18.17.0
- Operating System: macOS (darwin 24.3.0)
- tailwindcss version: 4.1.2
- @tailwindcss/vite: 4.1.2
Notes
The error suggests that the build system is trying to use CommonJS require() to load an ESM-only package (@tailwindcss/vite). Tailwind CSS 4 has migrated to ESM-only modules, which is causing compatibility issues with Bolt-CEP's build system that likely expects CommonJS modules. According to the Vite troubleshooting guide, this indicates a module compatibility issue between ESM and CommonJS modules.