AOSSIE-Org / AOSSIE-Org/DebateAI

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

未關閉
#208 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
TypeScript
星號
84
分支
198
平均合併
2 天 19 小時
30 天內合併 PR
30

描述

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

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。