AOSSIE-Org / AOSSIE-Org/DebateAI

ReferenceError: require is not defined in tailwind.config.js (Node.js v22)

Đang mở
#208 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
84
Fork
198
Merge trung bình
2 ngày 19 giờ
Pull request đã merge (30 ngày)
30

Mô tả

I am encountering a `ReferenceError: require is not defined` while running frontend.

It appears that `tailwind.config.js` is being interpreted as an **ES Module**, but the configuration file still uses **CommonJS syntax (`require()`)**, which leads to the error.

### Error Output

```
ReferenceError: require is not defined
```
### Expected Behavior

Tailwind CSS should either:

* Correctly handle CommonJS syntax in `tailwind.config.js`, or
* Clearly document that the configuration file must use ES Module syntax (`import` / `export`) when running on newer Node.js versions.

### Actual Behavior

The build process fails immediately with a `ReferenceError`, preventing the application from running.

The issue is resolved by either:
Renaming tailwind.config.js to tailwind.config.cjs, or
Converting the config file to ES Module syntax.

Please let me know if this is the expected behavior or if there is a recommended solution, and assign to me
@bhavik-mangla

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.