在 netlify 中部署我的项目,但“build.command”不可用修复失败

发布于 2025-01-15 00:24:06 字数 1468 浏览 0 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

放肆 2025-01-22 00:24:06

您的代码中有多个警告/错误需要修复才能编译。将来,请考虑在将代码推送到 GitHub 或 Netlify 等代码服务器之前,在本地计算机上编译开发版本。 阅读错误消息也会有所帮助。

还请将错误消息括在代码块中,并在以下情况下插入换行符:必要的。这将使其他人更容易阅读您的错误消息。

TailwindCSS 警告 (1)

当您使用 TailwindCSS v3 时,请将 purge 属性更改为 content

// tailwind.config.js

module.exports = {
  content: [
    // ...
  ],
};

文档

TailwindCSS 警告 (2)

从 TailwindCSS v3 开始,darkMode 设置为 false 与设置为 media 相同。将其完全删除,因为不再需要它。仅当您需要将其设置为 class 时才使用它。

// tailwind.config.js

module.exports = {
  dark: false, // remove this
};

文档

React ESLint 错误 (3)

看起来像 <您的代码中的 code>useEffect() 缺少依赖项:navigate。根据代码的工作方式,您需要删除整个依赖项数组或向其中添加 navigate 依赖项。

删除整个依赖项数组:

// src/App.js
// line 14:6

useEffect(() => {
  // ...
});

添加 navigate 依赖项:

// src/App.js
// line 14:6

useEffect(() => {
  // ...
}, [navigate]);

的情况也是如此

  • fetchPinDetails 中 >src/components/PinDetails.jsx 第 64:6 行
  • activeBtnsrc/components/UserProfile.jsx 第 53:6 行
  • userInfo?.googleId in src/container/Home.jsx line 33:6

HTML/React ESLint 警告 (4)

在较旧的浏览器中,如果您有一个打开的链接不包含 rel="noreferrer" 的新选项卡(又名 target="_blank")存在安全风险。添加它以删除警告。如果您熟悉的话,它还意味着 noopener,因此您不需要添加它。

// src/components/Pin.jsx
// line 108:17

<a href="/example-page" target="_blank" rel="noreferrer">
  // ...
</a>

ESLint 警告 (5-6)

您定义了变量,但从未在任何地方使用过它。删除它们,除非您需要使用它们。

  • src/components/PinDetails.jsx 第 10:10 行中的 MdMaximize
  • src/components/PinDetails.jsx 中的 addingComment line 16:10

以后请在访问 Stack Overflow 之前阅读错误消息。如果您阅读并参考其链接的文档页面,所有这些错误或警告都可以轻松解决。

You have multiple warnings/errors in your code that needs to be fixed in order to compile. In the future, please consider compiling a development build on your local machine before pushing your code to a code server like GitHub or Netlify. Reading the error message will also help.

Please also enclose the error message in code blocks and insert newlines when necessary. This will make it much easier for others to read your error message.

TailwindCSS Warning (1)

Change the purge property to content as you're using TailwindCSS v3.

// tailwind.config.js

module.exports = {
  content: [
    // ...
  ],
};

Docs

TailwindCSS Warning (2)

As of TailwindCSS v3, darkMode being set to false is the same as if it is set to media. Remove it entirely as it isn't needed anymore. Only use it when you need it to be set to class.

// tailwind.config.js

module.exports = {
  dark: false, // remove this
};

Docs

React ESLint Error (3)

It seems like a useEffect() in your code is missing a dependency: navigate. Depending on how your code works, you will need to either remove the entire dependency array or add the navigate dependency to it.

Removing the entire dependency array:

// src/App.js
// line 14:6

useEffect(() => {
  // ...
});

Adding the navigate dependency:

// src/App.js
// line 14:6

useEffect(() => {
  // ...
}, [navigate]);

This is also the case with:

  • fetchPinDetails in src/components/PinDetails.jsx line 64:6
  • activeBtn in src/components/UserProfile.jsx line 53:6
  • userInfo?.googleId in src/container/Home.jsx line 33:6

HTML/React ESLint Warning (4)

In older browsers, if you have a link that opens on a new tab (a.k.a. target="_blank"), not including rel="noreferrer" is a security risk. Add it to remove the warning. It also implies noopener if you're familiar with that, so you don't need to add it.

// src/components/Pin.jsx
// line 108:17

<a href="/example-page" target="_blank" rel="noreferrer">
  // ...
</a>

ESLint Warning (5-6)

You have variables that are defined but it was never used anywhere. Remove those unless you need to use them.

  • MdMaximize in src/components/PinDetails.jsx line 10:10
  • addingComment in src/components/PinDetails.jsx line 16:10

In the future please read error messages before coming to Stack Overflow. All of these errors or warnings can be easily resolved if you read them and refer to their linked documentation pages.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文