简体   繁体   English

我无法让 Tailwind 运行 - 尝试了我所知道的一切

[英]I cannot get Tailwind to run - tried all that I know

I've been working on getting Tailwind to run for a good 6 hours.我一直在努力让 Tailwind 运行 6 个小时。 Got tailwind running on a more simple Nextjs/React/Typscript app, but I can't get it to run in this larger codebase.在更简单的 Nextjs/React/Typscript 应用程序上运行顺风,但我无法让它在这个更大的代码库中运行。

I know I must be making a dumb mistake, but I just don't know where to look at this point.我知道我一定犯了一个愚蠢的错误,但我只是不知道从哪里看这一点。

tailwind.config.cjs tailwind.config.cjs

module.exports = {
  content: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'],
  theme: {
    extend: {},
  },
  plugins: [],
};

_app.js _app.js

import '../styles/globals.css'
import Menu from '../components/splash-menu';
import { AppWrapper } from '../context/dataContext';
import { UserWrapper } from '../context/userContext';


function MyApp({ Component, pageProps }) {
  return (
  <>
  <AppWrapper>
    <UserWrapper>
    <Component {...pageProps} />
    </UserWrapper>
  </AppWrapper>
  </>

  )
}

export default MyApp

package.json package.json

{
  "name": "",
  "version": "1.0.0",
  "description": "A visualization and optimization insight tool for AWS Lambda",
  "main": "/dist/index.js/",
  "author": "",
  "scripts": {
    "clean": "rm dist/bundle.js",
    "compile-dev": "npx tsc -w",
    "compile-prod": "npx tsc",
    "build-dev": "webpack --mode development",
    "build-prod": "webpack --mode production",
    "start": "nodemon --es-module-specifier-resolution=node dist/server.js",
    "dev": "next dev -p 4000 & webpack serve --hot --mode development & nodemon --es-module-specifier-resolution=node dist/server/server.js",
    "test": "NODE_OPTIONS=--experimental-vm-modules npx jest --verbose --no-cache",
    "next-dev": "next dev -p 4000",
    "next-build": "next build",
    "ns": "next start",
    "next-lint": "next lint"
  },
  "keywords": [],
  "license": "ISC",
  "type": "module",
  "dependencies": {
    "-": "^0.0.1",
    "@aws-sdk/client-cloudwatch": "^3.78.0",
    "@aws-sdk/client-lambda": "^3.78.0",
    "@aws-sdk/client-sts": "^3.78.0",
    "@types/bcryptjs": "^2.4.2",
    "@types/recharts": "^1.8.23",
    "autoprefixer": "^10.4.7",
    "aws-sdk": "^2.1122.0",
    "axios": "^0.27.2",
    "bcrypt": "^5.0.1",
    "bcryptjs": "^2.4.3",
    "cors": "^2.8.5",
    "d3": "^7.4.4",
    "dotenv": "^16.0.0",
    "express": "^4.17.3",
    "moment": "^2.29.3",
    "mongoose": "^6.3.1",
    "next": "^12.1.5",
    "postcss": "^8.4.13",
    "react": "^18.0.0",
    "react-dom": "^18.0.0",
    "recharts": "^2.1.9",
    "sass": "^1.51.0",
    "save": "^2.5.0",
    "tailwindcss": "^3.0.24",
    "uuid": "^8.3.2",
    "webpack": "^5.72.0"
  },
  "devDependencies": {
    "@babel/core": "^7.17.9",
    "@babel/preset-env": "^7.16.11",
    "@babel/preset-react": "^7.16.7",
    "@babel/preset-typescript": "^7.16.7",
    "@types/bcryptjs": "^2.4.2",
    "@types/cors": "^2.8.12",
    "@types/express": "^4.17.13",
    "@types/jest": "^27.4.1",
    "@types/mongoose": "^5.11.97",
    "@types/node": "^17.0.27",
    "@types/react": "^18.0.0",
    "@types/react-dom": "^18.0.0",
    "@types/react-router-dom": "^5.3.3",
    "@types/regenerator-runtime": "^0.13.1",
    "@types/uuid": "^8.3.4",
    "babel-loader": "^8.2.5",
    "css-loader": "^6.7.1",
    "eslint": "8.14.0",
    "eslint-config-next": "12.1.5",
    "html-webpack-plugin": "^5.5.0",
    "jest": "^28.0.0",
    "nodemon": "^2.0.15",
    "sass-loader": "^12.6.0",
    "style-loader": "^3.3.1",
    "ts-loader": "^9.2.8",
    "ts-node": "^10.7.0",
    "typescript": "^4.6.3",
    "webpack": "^5.72.0",
    "webpack-cli": "^4.9.2",
    "webpack-dev-server": "^4.8.1"
  }
}

globals.css globals.css

body {
  padding: 0;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
    Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

* {
  box-sizing: border-box;
}

@tailwind base;
@tailwind components;
@tailwind utilities;

just add these three lines at the top of global.css instead of bottom.只需将这三行添加到global.css的顶部而不是底部。

@tailwind base;
@tailwind components;
@tailwind utilities;

body {
  padding: 0;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
    Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

* {
  box-sizing: border-box;
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我不能让这个调度 function 运行? - Why I cannot get this dispatch function to run? 如何同时运行 nodemon 和 tailwind? - How can I run nodemon and tailwind at the same time? 我想让我的盒子偏移,我尝试放置属性但没有任何反应。 我使用 Tailwind 和 React - I want to make my box offset, I tried putting the property but nothing happens. I use Tailwind & React 当我知道所有异步调用都已完成时,如何运行回调? - How can I run a callback when I know all asynchronous calls have been completed? 我怎样才能通过顺风获得类似 pinterest 的布局并做出反应? - How can i get the pinterest-like layout with tailwind and react? 我想用@keyframes 将 animation 添加到 div 中。 我基本上已经尝试了我所知道的一切 - i want to add an animation to the div with @keyframes. I have tried basically everything i know 无法将 innerHTML 设置为 null,我尝试过的一切都没有奏效 - cannot set innerHTML of null and nothing i tried has worked 尝试使用正则表达式拆分字符串。 我无法提取括号 - Tried to split string using regex. I cannot extract the parentheses 当我向我显示此错误“无法读取未定义的属性(读取'_internalPath')”时,我尝试使用nodejs和firestore中的过滤器获取数据 - I tried to get data using filter in nodejs and firestore when show me this error "Cannot read properties of undefined (reading '_internalPath')" ';' expected.ts(1005).我得到一个错误并且无法运行它 - ';' expected.ts(1005) .I get an error and cannot run it
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM