gpt4 book ai didi

ecmascript-6 - 如何在 create-react-app 中定义 process.env.ENV?

转载 作者:行者123 更新时间:2023-12-01 04:47:59 26 4
gpt4 key购买 nike

同版本1.0.5create-react-app样板我已经开始收到休耕警告:*** process.env.ENV is not defined, assuming 'prod' env
我知道如何创建自定义环境变量,但那些需要 REACT_APP_字首。

现在,我发现显示消息是因为 Chrome 的 Grammarly扩展,并禁用它会删除消息。

但是,无论扩展名如何,我都想知道如何解决此问题。

我知道 StackOverflow 上还有 2 个这样的问题,但它们包括使用 Webpack 的解决方案。不幸的是,我无法访问 Webpack,因为我还没有弹出 create-react-app,而且我不打算很快这样做。

有没有办法在 process.env.ENV 上声明环境在 create-react-app ?

编辑:

这是主要问题。技术上是否可以在 中定义它?未弹出 create-react-app ?

最佳答案

语法扩展不是 React 的原因。已向 Grammarly Support 记录了一个请求,这是结果

Hailey (Grammarly Support) Jul 6, 11:33 PM PDT

Hi Lankymart,

Thank you for contacting Grammarly Customer Support!

Please rest assured that the technical team is aware of the problem and they are currently working on it.

Unfortunately, this will not be a quick fix and I cannot provide you with an estimated timeframe, as the developers will need some time to analyze the cause of this issue.

I’m going to close this case, but if you have further information regarding this issue, please reply to this email and the case will be re-opened for further investigation. We apologize for any inconvenience caused.

Best wishes, Hailey


Lankymart Jul 6, 12:49 PM PDT

The console window in Chrome is constantly showing the warning - "process.env.ENV is not defined" turning off the extensions removes the error, it is not related a specific website. Already on the internet threads are popping up with people reporting the same issue and the common thread is Grammarly. Has a bug been introduced into the extension perhaps?

Evidence:

https://github.com/facebookincubator/create-react-app/issues/2722#issuecomment-313017403 How to define process.env.ENV in create-react-app? https://stackoverflow.com/a/44940512/692942

Website URL: No specific URL issue is a extension bug.

关于ecmascript-6 - 如何在 create-react-app 中定义 process.env.ENV?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44919392/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com