@parcel/transformer-css:规则未知:@tailwind
我正在尝试设置我的React tablewind Antycript项目。但是,我偶然发现了一个错误,我很难解决。
@parcel/transformer-css: Unknown at rule: @tailwind
/home/sizzions/Projects/trials/owen/src/index.css:1:10
> 1 | @tailwind base;
> | ^
2 | @tailwind components;
3 | @tailwind utilities;
我的index.css文件
@tailwind base;
@tailwind components;
@tailwind utilities;
index.tsx
import React from 'react';
import { createRoot } from 'react-dom/client';
import { Provider } from 'react-redux';
import { store } from './app/store';
import App from './App';
const container = document.getElementById('root')!;
const root = createRoot(container);
root.render(
<React.StrictMode>
<Provider store={store}>
<App />
</Provider>
</React.StrictMode>
);
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="../index.css" >
<title>Owen's Bloggy</title>
</head>
<body>
<div id="root">
</div>
<script type="module" src="./../index.tsx">
</script>
</body>
</html>
任何人都可以协助设置或提供任何包裹打字机模板
I am trying to set up my react tailwind an typescript project. However i stumbled across an error that i have a hard time getting around.
@parcel/transformer-css: Unknown at rule: @tailwind
/home/sizzions/Projects/trials/owen/src/index.css:1:10
> 1 | @tailwind base;
> | ^
2 | @tailwind components;
3 | @tailwind utilities;
my index.css file
@tailwind base;
@tailwind components;
@tailwind utilities;
index.tsx
import React from 'react';
import { createRoot } from 'react-dom/client';
import { Provider } from 'react-redux';
import { store } from './app/store';
import App from './App';
const container = document.getElementById('root')!;
const root = createRoot(container);
root.render(
<React.StrictMode>
<Provider store={store}>
<App />
</Provider>
</React.StrictMode>
);
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="../index.css" >
<title>Owen's Bloggy</title>
</head>
<body>
<div id="root">
</div>
<script type="module" src="./../index.tsx">
</script>
</body>
</html>
can anyone assist set up or provide any parcel typescript template
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我刚刚遇到了相同的错误消息,它是由缺失的
.postcssrc
配置文件引起的:请参见 https://parceljs.org/recipes/react/#tailwind-css
I just encountered the same error message and it was caused by a missing
.postcssrc
configuration file:see https://parceljs.org/recipes/react/#tailwind-css
您缺少
rel
属性rel
属性定义了当前页面和链接页面或资源之间的关系。a
rel =“ stylesheet”
值指定样式表文件将加载到当前页面中。CSS样式表的URL由
href
attribute指定
语法
指定。转换
为
You are missing the
rel
attributeThe
rel
attribute defines the relationship between the current page and the linked page or resource.A
rel="stylesheet"
value specifies that the stylesheet file will be loaded into the current page.The URL for the CSS stylesheet is specified by the
href
attributeSyntax
Hence to solve the problem. Convert
To
在导入CSS文件时
forgot to add
rel='stylesheet'
inindex.html
when importing css file对于试图从库中导出CSS(带有尾风)并获取此错误的人们。
要解决它,需要PostCSS变压器:
.parcelrc:
package.json:
For people trying to export css (with tailwind) from a library and getting this error.
to fix it, postcss transformer is required:
.parcelrc:
package.json: