【发布时间】:2021-05-04 19:11:58
【问题描述】:
我在通过npm run build 构建并使用npm run start 启动它后遇到此错误
知道为什么会出现这个错误吗?
我的整个布局也错了,我猜是因为tailwindcss错误
这是我的 _app.tsx
import type { AppProps } from 'next/app'
import "tailwindcss/tailwind.css"
import "../styles/styles.scss"
import { Provider, useSelector } from 'react-redux'
import { Application } from 'react-rainbow-components'
import { ThemeStore } from '../config/redux/ThemeStore'
import { theme } from '../config/react-rainbow/react-rainbow-config'
import { ThemeState } from '../config/redux/ThemeReducer'
import Navigation from '../components/navigation/Navigation'
const Child: React.FC = ({ children }) => {
const isDark = useSelector<ThemeState, ThemeState["isDark"]>(state => state.isDark)
return <div className={`${isDark ? "dark blackThemeColor test" : "white whiteThemeColor"}` + " min-h-screen font-body pr-0"} style={{ height: '150vh' }}>{children}</div>;
}
const MyApp = ({ Component, pageProps }: AppProps) => {
return (
<Provider store={ThemeStore}>
<Application theme={theme}>
<Child>
<Navigation />
<Component {...pageProps} />
</Child>
</Application>
</Provider>
);
};
export default MyApp
感谢所有帮助
【问题讨论】:
-
您为什么要直接在您的
_app中导入"tailwindcss/tailwind.css"?你不应该这样做。
标签: reactjs next.js tailwind-css