通过Chrome和Firefox连接到Local主机上的Netlify

发布于 2025-01-21 12:49:56 字数 2517 浏览 0 评论 0原文

我正在尝试关注此教程

在55:39 Ania可以连接到她的Localhost:8888/.netlify端口,以查看她从GraphQl Playground中阅读的记录。

我正在尝试做同样的事情,但无法连接到页面。我已经尝试了Chrome和Firefox,在这两种情况下,我都会收到一个连接拒绝的错误消息。

我的防火墙已允许访问Chrome和Firefox,甚至尝试禁用防火墙。错误仍然返回。

我在没有VPN打开的情况下尝试了它。

我已经登录了Netlify(我在Github上什么都没有,所以这只是本地部署)。

我需要做一些特殊的事情,以便能够使用Netlify运行本地主机?

错误消息的全文是:

无法拒绝连接此站点。尝试:

检查连接检查代理和防火墙 err_connection_refuse检查您的Internet连接检查任何电缆 然后重新启动您可能是的任何路由器,调制解调器或其他网络设备 使用。允许Chrome访问您的防火墙中的网络或 防病毒设置。如果已将其列为允许的程序 访问网络,尝试将其从列表中删除并再次添加。 如果您使用代理服务器...检查您的代理设置或联系您的 网络管理员确保代理服务器正在工作。 如果您不相信应该使用代理服务器:转到 应用>系统偏好>网络>高级代理和 取消选择已选择的所有代理。

关于#1,我已连接到Internet。我可以在端口3000上运行本地主机,并将React应用程序加载。它没有从GraphQl读取任何内容。当我主持从React应用程序记录DataStax数据时,我的结果是无效的(Ania在教程的第一个小时内获取记录)。

关于#2,与

#3相关的防火墙都添加了Chrome和Firefox,不使用代理 - 除了检查使用FTP模式PASV的框外。我尝试取消选中,但没有区别。

我尝试将本地主机8888 URL添加为这些主机的旁路代理设置&我的系统偏好中的域 - 但这没有什么区别。

我的控制台显示:

netlify dev dev◈忽略了一般上下文env var:lang(定义在 过程)◈注入.env文件env var:astra_graphql_endpoint◈ 注入.env文件env var:astra_db_application_token◈加载 功能getgerres

http:// localhost:8888/.netlify/functions/getgerres。 ◈功能服务器 在55302上聆听◈启动使用Create React App $启动NetLify Dev react-scripts启动(节点:55384) [dep_webpack_dev_server_on_ofter_setup_middleware] eprecationwarning: 弃用了“ OnafterSetupMiddleware”选项。请使用 “ setupmiddlewares”选项。 (使用节点 - Trace-Deprectation ...显示 发出警告的位置)(节点:55384) [dep_webpack_dev_server_on_before_setup_middleware] 弃用:“ beforesetupmiddleware”选项已弃用。 请使用“ setupmiddlewares”选项。开始发展 服务器...

成功地编译!

您现在可以在浏览器中查看NextFlix-Datastax-Clone。

本地:http:// localhost:3000在您的网络上: http://10.0.0.1:3000

请注意,开发构建未进行优化。创建一个 生产构建,使用纱线构建。

WebPack成功编译了

一个线索:我已经清理了Mac,我清除了缓存(不知道为什么这会起作用,因为Localhost 3000加载了React应用程序,但没有DataStax数据)。我的Mac上出现了一个小盒子,上面写着“验证AID.DYLIB”。我了解Dylib的意思是共享数据库(也许是某种dataStax引用?该过程已经运行了将近48小时,而进度栏则约为10%。无论该程序是什么,尚未得到验证。我想知道这是否是这样这就是为什么我不能加载local主持:8888/.netifly以与另一个线索一样

:我刚刚找到了这篇文章: https://github.com/netlify/cli/issues/3617 这表明Netlify无法在V17中读取功能。我不知道这是否仍然是当前的。I当前,我的努力是否是问题的来源,因为我的啤酒命令不会在我的终端中运行。发布如果我找到一种配置我的计算机的方法,以便能够遵循基本的初学者教程。

I am trying to follow this tutorial.

At 55:39 Ania is able to connect to her localhost:8888/.netlify port to see the records she has read from the graphql playground.

I am trying to do the same but cannot connect to the page. I have tried in both chrome and firefox and in both cases, I get a connection refused error message.

My firewall has permitted access for both chrome and firefox, and I even tried disabling the firewall. The error still returns.

I tried it without my vpn turned on.

I have logged into netlify (I have nothing on github yet, so it's just a local deployment).

Is there something special I need to do to be able to run local host with netlify?

The full text of the error message is:

This site can’t be reachedlocalhost refused to connect. Try:

Checking the connection Checking the proxy and the firewall
ERR_CONNECTION_REFUSED Check your Internet connection Check any cables
and reboot any routers, modems or other network devices you may be
using. Allow Chrome to access the network in your firewall or
antivirus settings. If it is already listed as a program allowed to
access the network, try removing it from the list and adding it again.
If you use a proxy server… Check your proxy settings or contact your
network administrator to make sure that the proxy server is working.
If you don't believe you should be using a proxy server: Go to
Applications > System Preferences > Network > Advanced > Proxies and
deselect any proxies that have been selected.

In relation to #1, I am connected to the internet. I can run the local host on port 3000 and get the react app to load. it does not read anything from graphql. When I console log the datastax data from the react app, I get null as a result (where Ania gets the records created in the first hour of the tutorial).

In relation to #2, chrome and firefox are both added to my firewall

In relation to #3, no proxies are used - except the box to use FTP Mode PASV is checked. I tried unchecking it but it makes no difference.

I tried adding the local host 8888 url as a Bypass proxy settings for these Hosts & Domains in my system preferences - but it makes no difference.

My console shows:

◈ Netlify Dev ◈ ◈ Ignored general context env var: LANG (defined in
process) ◈ Injected .env file env var: ASTRA_GRAPHQL_ENDPOINT ◈
Injected .env file env var: ASTRA_DB_APPLICATION_TOKEN ◈ Loaded
function getGenres

http://localhost:8888/.netlify/functions/getGenres. ◈ Functions server
is listening on 55302 ◈ Starting Netlify Dev with Create React App $
react-scripts start (node:55384)
[DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning:
'onAfterSetupMiddleware' option is deprecated. Please use the
'setupMiddlewares' option. (Use node --trace-deprecation ... to show
where the warning was created) (node:55384)
[DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE]
DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated.
Please use the 'setupMiddlewares' option. Starting the development
server...

Compiled successfully!

You can now view nextflix-datastax-clone in the browser.

Local: http://localhost:3000 On Your Network:
http://10.0.0.1:3000

Note that the development build is not optimized. To create a
production build, use yarn build.

webpack compiled successfully

ONE CLUE: I have cleaned my mac, I have cleared my cache (don't know why this would have worked since localhost 3000 loads the react app, but without the datastax data). A little box appears on my mac that says 'verifying AID.dylib'. I understand dylib means a shared database (maybe this some sort of Datastax reference? The process has been running almost 48 hours and the progress bar is at about 10%. Whatever that program is, it hasn't been verified. I wonder if this is why I can't load localhost:8888/.netifly in the same way that Ania can?

ANOTHER CLUE: I just found this post: https://github.com/netlify/cli/issues/3617 which suggests that Netlify can't read functions in v17. I don't know if that's still current. I'm currently stuck in my efforts to check if this is the source of the problem because my brew commands wont run in my terminal. I think this may be because of some incompatibility with the macOS Monteray upgrade that I just installed. I will update this post if I find a way to configure my computer to be able to follow a basic beginner's tutorial.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文