-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Importing generateTailwindCSS causes Next.js (webpack) to attempt bundling a native .node binary from @tailwindcss/oxide-*, leading to:
(base) api@Apiphooms-MacBook-Pro-3 tailwind-iso-poc % pnpm build
> [email protected] build /Users/api/Desktop/tailwind-iso-poc
> next build
⚠ Warning: Next.js inferred your workspace root, but it may not be correct.
We detected multiple lockfiles and selected the directory of /Users/api/pnpm-lock.yaml as the root directory.
To silence this warning, set `outputFileTracingRoot` in your Next.js config, or consider removing one of the lockfiles if it's not needed.
See https://nextjs.org/docs/app/api-reference/config/next-config-js/output#caveats for more information.
Detected additional lockfiles:
* /Users/api/Desktop/tailwind-iso-poc/pnpm-lock.yaml
▲ Next.js 15.5.2
Creating an optimized production build ...
Warning: Built-in CSS support is being disabled due to custom CSS configuration being detected.
See here for more info: https://nextjs.org/docs/messages/built-in-css-disabled
Warning: Built-in CSS support is being disabled due to custom CSS configuration being detected.
See here for more info: https://nextjs.org/docs/messages/built-in-css-disabled
Failed to compile.
./node_modules/.pnpm/@[email protected]/node_modules/@tailwindcss/oxide-darwin-arm64/tailwindcss-oxide.darwin-arm64.node
Module parse failed: Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)
Import trace for requested module:
./node_modules/.pnpm/@[email protected]/node_modules/@tailwindcss/oxide-darwin-arm64/tailwindcss-oxide.darwin-arm64.node
./node_modules/.pnpm/@[email protected]/node_modules/@tailwindcss/oxide/index.js
./node_modules/.pnpm/[email protected][email protected]/node_modules/tailwindcss-iso/src/server/get-tailwind-classes.js
./node_modules/.pnpm/[email protected][email protected]/node_modules/tailwindcss-iso/src/server/index.js
./src/app/page.tsx
./node_modules/.pnpm/[email protected]/node_modules/lightningcss/node/index.js
Module not found: Can't resolve '../pkg'
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module:
./node_modules/.pnpm/[email protected]/node_modules/lightningcss/node/index.mjs
./node_modules/.pnpm/@[email protected]/node_modules/@tailwindcss/node/dist/index.mjs
./node_modules/.pnpm/[email protected][email protected]/node_modules/tailwindcss-iso/src/server/generate-tailwind-css.js
./node_modules/.pnpm/[email protected][email protected]/node_modules/tailwindcss-iso/src/server/index.js
./src/app/page.tsx
./src/app/globals.css
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> @import "tailwindcss";
|
| :root {
Import trace for requested module:
./src/app/globals.css
./src/app/layout.tsx
> Build failed because of webpack errors
ELIFECYCLE Command failed with exit code 1.
I’m using generateTailwindCSS in a client component:
"use client";
import { useEffect, useState } from "react";
import { generateTailwindCSS } from "tailwindcss-iso";
function IsoExample() {
const [css, setCss] = useState("");
useEffect(() => {
const content = `<div class="p-4 bg-blue-500 text-white">Hello Tailwind-iso</div>`;
generateTailwindCSS({ content }).then(setCss);
}, []);
return (
<>
<style>{css}</style>
<div className="p-4 bg-blue-500 text-white">Hello Tailwind-iso styled</div>
</>
);
}
export default IsoExample;
Environment
Next.js: 15.5.2 (webpack build)
Node: (please see CI/maintainers can assume LTS; I can add exact version if needed)
Package manager: pnpm
tailwindcss-iso: 1.0.6
tailwindcss: 4.1.12
@tailwindcss/node: 4.1.12
OS/arch: macOS arm64
Steps to Reproduce
Create Next.js 15 app (App Router).
pnpm add tailwindcss-iso tailwindcss @tailwindcss/node
Add the component above to app/page.tsx.
pnpm build.
Actual Result
Webpack fails parsing tailwindcss-oxide.*.node.
Metadata
Metadata
Assignees
Labels
No labels