-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Execute Shopify theme dev with error message: request to xxx.theme.json?xxx processing failed, reason: read ETIMEDOUT #3225
Comments
Find some wrong things, This problem caused by country firewall , in some country (cn), you can't visit shopify resource now, after 1.4 or 1.5 of 2024 ----------------------------240106 update Yes, I'm sure the answer is right above, after test , Suggest Shopify CLI add --proxy and alias -p option for command option, or use terminal http_proxy or https_proxy directly, we will use proxy self! This problem has been temporarily solved, and I feel a little more relaxed now. I can't imagine how painful it will be if you can't use shopify for local development. |
感谢您的帮忙。您太棒了!👍 Thank you for your help. You're amazing!👍 |
@forwells I think you are right, this issue drive me ( and my partner ) nuts. now it's fixed by terminal http_proxy or https_proxy. And also, under CMCC network (in China) also have some api request hang issues, we change from CMCC to Telecom before, hope this info can help other domestic bro. |
@NickOpen 你的Shopify-cli可以正常工作了吗?是的话,可以跟我分享下你的 http_proxy or https_proxy 是怎么设置的吗?我不知道怎么通过设置这个解决问题。感谢🙏 |
遇到了同样的问题,有解决方案了吗 |
@MyBaymax , @Shenr1 do a temporarily resolve plan, make these change : in your global npm/yarn/pnpm package directory, find the package path: then: export async function fetch(url, init) { before add agent to node-fetch, please make sure install |
非常感谢 @forwells 提供的方案 🙏。我使用@forwells提供的方案后,已可以正常使用Shopify-cli。 Thank you very much for the solution provided by @forwells 🙏. After using the solution provided by @forwells, I can now use Shopify cli normally. |
I carefully followed the instructions you provided and added the necessary code to the specified files. However, despite these modifications, the error continues to persist.
To provide you with more details, I have attached the modified versions of the following files:
***@***.******@***.***\cli-kit\dist\public\node\http.js
***@***.******@***.***\cli-kit\dist\public\node\http.js
Please review the changes I made and let me know if there is anything else I can try to resolve this issue. Your assistance is greatly appreciated.
李泽明
***@***.***
…------------------ 原始邮件 ------------------
发件人: "Shopify/cli" ***@***.***>;
发送时间: 2024年1月8日(星期一) 晚上9:45
***@***.***>;
***@***.******@***.***>;
主题: Re: [Shopify/cli] [Bug]: Execute Shopify theme dev with error message: request to xxx.theme.json?xxx processing failed, reason: read ETIMEDOUT (Issue #3225)
@MyBaymax , @Shenr1 do a temporarily resolve plan, make these change :
in your global npm/yarn/pnpm package directory, find the package path:
***@***.***/cli-kit/dist/public/node/http.js
then:
export async function fetch(url, init) {
console.log('termial proxy')
const proxy_url = process.env.HTTP_PROXY || process.env.HTTPS_PROXY;
const agent = new HttpsProxyAgent(proxy_url)
return runWithTimer('cmd_all_timing_network_ms')(() => debugLogResponseInfo({ url: url.toString(), request: nodeFetch(url, { ...init, agent }) }));
}
before add agent to node-fetch, please make sure install https-proxy-agent package global installed, have fun day!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@Shenr1 @wantgoworld 可以发下你们终端输出的信息,以便确认错误原因 |
╭─ error ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
@wantgoworld 如果你的终端没有打印 |
找到问题了。谢谢 |
I've changed the code in the right place
PS G:\Ryen\Theme\Atomstack v2_0> shopify theme dev -e dev
>>
╭─ info ─────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Using applicable flags from dev environment: │
│ │
│ • store: tinysextoys.myshopify.com │
│ • theme: 137206006010 │
│ │
╰────────────────────────────────────────────────────────────────────────────────────────╯
termial proxy1
╭─ error ────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Cannot read properties of undefined (reading 'href') │
│ │
│ To investigate the issue, examine this stack trace: │
│ at new HttpsProxyAgent │
│ (Users/Admin/AppData/Roaming/npm/node_modules/https-proxy-agent/dist/index.js:55) │
│ at fetch ***@***.***/theme/node_modules │
│ ***@***.***/cli-kit/dist/public/node/http.js:40) │
│ at restRequest ***@***.***/theme/node_m │
│ ***@***.***/cli-kit/dist/public/node/api/admin.js:113) │
│ at ***@***.******@***.*** │
│ ify/cli-kit/dist/public/node/themes/themes-api.js:38) │
│ at performRequest ***@***.***/theme/nod │
│ ***@***.***/cli-kit/dist/private/node/themes/themes-api/throttler.js:7) │
│ at throttleByCounter ***@***.***/theme/ │
│ ***@***.***/cli-kit/dist/private/node/themes/themes-api/throttler.js:33) │
│ at throttleByHeader ***@***.***/theme/n │
│ ***@***.***/cli-kit/dist/private/node/themes/themes-api/throttler.js:19) │
│ at throttleByCounter ***@***.***/theme/ │
│ ***@***.***/cli-kit/dist/private/node/themes/themes-api/throttler.js:33) │
│ at ***@***.******@***.*** │
│ ify/cli-kit/dist/private/node/themes/themes-api/throttler.js:41) │
│ at new Promise │
│ │
╰────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: Cannot read properties of undefined (reading 'href')
李泽明
***@***.***
…------------------ 原始邮件 ------------------
发件人: "Shopify/cli" ***@***.***>;
发送时间: 2024年1月9日(星期二) 中午12:26
***@***.***>;
***@***.******@***.***>;
主题: Re: [Shopify/cli] [Bug]: Execute Shopify theme dev with error message: request to xxx.theme.json?xxx processing failed, reason: read ETIMEDOUT (Issue #3225)
@wantgoworld 如果你的终端没有打印 termail proxy, 则说明你的在vscode中执行的 shopify-cli 并非你修改的 fetch 位置
找到问题了。谢谢
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@Shenr1 你这代码看了太难受了,可以处理下格式吗😣 |
@MyBaymax 按照上面的方案 去修改http.js的代码,可以获取到json文件,但是ssl失败了 |
我没有遇到这个问题 |
@MyBaymax |
是的,还需要导入 |
给大家写下具体步骤完整Shopify-cli代理设置步骤Step1: 确认文件位置例如我是使用 brew 安装的,可以通过 baymax@chouyaofandedeMacBook-Pro remix-shopify % brew list shopify-cli
/usr/local/Cellar/shopify-cli/3.53.0/bin/shopify
/usr/local/Cellar/shopify-cli/3.53.0/libexec/bin/ (2 files)
/usr/local/Cellar/shopify-cli/3.53.0/libexec/lib/ (57641 files) Step2: 进入
|
非常感谢,按以上具体方法问题已解决!! |
我重装了cli ,修改了http.js文件,文件可以确定没错但是不走fetch方法,麻烦看看是什么原因,感激不尽! |
Try add https agent to shopifyFetch() methd in the http.js as well. |
Can you show me the modified code? Thank you very much! |
你有解决吗? 我也碰到相似的问题了 |
@Shenr1 , @lizhenmiao 你可以试下将shopify更新至 v3.56.3,我当前使用的是该版本,可正常使用。
|
非常感谢, 我现在使用 proxifier 暂时可以使用了. 请问你们有交流群吗, 有的话能分享一下吗? 我使用的 MAC, 本来想重装一下 shopify-cli 试试, 然后使用 brew install shopify-cli 安装的为最新版本的3.60.0, 我不知道要怎么安装指定版本的 shopify-cli, 并且我找到 shopify-cli 的目录之后发现文件内容跟之前的路径不一样 |
给大家更新下@shopify/cli v3.60.0 的代理设置方案
// 引入 HttpsProxyAgent, 可以在 cli 目录下安装 https-proxy-agent
import { HttpsProxyAgent } from "https-proxy-agent";
// ....
// 修改函数
async function fetch2(url2, init) {
const proxy_url = "http://127.0.0.1:10010";
const agent = new HttpsProxyAgent(proxy_url);
return runWithTimer("cmd_all_timing_network_ms")(
() => debugLogResponseInfo({ url: url2.toString(), request: fetch(url2, { ...init,
agent}) })
);
}
async function shopifyFetch(url2, init) {
const proxy_url = "http://127.0.0.1:10010";
const agent = new HttpsProxyAgent(proxy_url);
const sanitizedUrl = sanitizeURL(url2.toString());
const options = {
agent,
...init ?? {},
headers: {
...await buildHeaders(),
...init?.headers ?? {}
}
};
outputDebug(outputContent`Sending ${options.method ?? "GET"} request to URL ${sanitizedUrl}
With request headers:
${sanitizedHeadersOutput(options?.headers ?? {})}
`);
return runWithTimer("cmd_all_timing_network_ms")(async () => {
return debugLogResponseInfo({ url: url2.toString(), request: fetch(url2, { ...init, agent }) });
});
} |
使用
有人遇到类似的问题吗 |
我换了一种方式,在 NextJs 中使用 fetch 来获取 ShopifyData:
同样报和 TLS 相关的错:
|
@Guo8a |
@MyBaymax
其中
不知道您是否遇到过这种情况?或者我的使用是否正确 |
我按照这个教程:https://shopify.dev/docs/custom-storefronts/hydrogen/getting-started,尝试运行项目,运行 npm run dev,是可以运行的。
3.尝试重新运行 经过改动,依然会报错 |
@Guo8a 感觉你对代理地址好像存在误解。代理地址并不是指你手动设置的环境变量http_proxy。正确的代理地址是只你VPN启用的代理地址。你应该通过你使用的代理软件查看代理,或者查看网络适配器中的代理地址 |
|
@gua8a |
十分百分千分万分感谢您的耐心指导。 再次感谢大佬,可否再留个联系方式交流下问题,不胜感激。 |
微信 abc939039210 |
我通过brew 安装的shopify-cli 3.60.1,它的目录结构似乎发生了变化,不再有http.ts文件,而是需要修改/usr/local/Cellar/shopify-cli/3.60.1/libexec/lib/node_modules/@shopify/cli/dist/chunk-BKLNHG3A.js(具体目录依据安装路径和安装版本)。
|
Hi, I am also a Shopify-cli user based in china I haven't set up any proxy and am facing this problem. can any one tell me how to set up the proxy? |
其实就是设置个全局代理即可。无需改任何代码 |
我通过brew 安装的shopify-cli 3.63.2,已经没有httpjs文件了。 |
老哥指导下怎么操作? |
@Guo8a 哥我遇到的是和你一样的问题,哥你是怎么解决的呀,我也是能run dev,但是npx shopify hydrogen link报错了,我想咨询下怎么去解决 |
你这问题咋解决的哥 |
用VPN |
你好,我现在也遇到了这个问题,同样的install了https-proxy-agent,修改了 但是修改之前提示的是reason: Client network socket disconnected before secure TLS connection was established 我该如何解决? |
Please confirm that you have:
In which of these areas are you experiencing a problem?
Theme
Expected behavior
Start development services
Actual behavior
request to https://amirobeauty-com.myshopify.com/admin/api/unstable/themes │
│ .json?fields=id%2Cname%2Crole%2Cprocessing failed, reason: read ETIMEDOUT
Verbose output
Reproduction steps
shopify theme dev -t=162423603516 -s=amirobeauty-com --verbose
Operating System
macOS Sonoma 14.1.2
Shopify CLI version (check your project's
package.json
if you're not sure)3.51.2
Shell
zsh
Node version (run
node -v
if you're not sure)v21.4.0
What language and version are you using in your application?
No response
The text was updated successfully, but these errors were encountered: