Erwin
11/30/2021, 10:53 AMgeelen
11/30/2021, 10:59 AMErwin
11/30/2021, 12:14 PMJeremiahlee
11/30/2021, 12:20 PMwrangler pages dev
?Greg Brimble | Cloudflare Pages
11/30/2021, 12:28 PMwrangler pages dev --binding BINDING_NAME=value
. Would you expect them to be automatically populated?Jeremiahlee
11/30/2021, 12:31 PMVAR_NAME=foo wrangler pages dev
and was surprised that did not work.chrisjmccreadie
11/30/2021, 1:54 PMenv
parameter passed to exported handlers or Durable Object constructors.Greg Brimble | Cloudflare Pages
11/30/2021, 2:08 PMts
export const onRequest = (context) => {
return new Response(context.env.BINDING_NAME)
}
MrBBot
11/30/2021, 2:18 PMchrisjmccreadie
11/30/2021, 2:51 PMJeremiahlee
11/30/2021, 3:00 PMMarcelino Franchini
11/30/2021, 5:52 PMSkye
11/30/2021, 5:53 PMMarcelino Franchini
11/30/2021, 5:54 PMHardAtWork
11/30/2021, 5:56 PMtdep
11/30/2021, 6:43 PMErwin
11/30/2021, 8:38 PMtdep
12/01/2021, 7:29 AMjohanndev
12/01/2021, 8:19 AM--local
flag?
2. Are you using the correct port to access you app? The default is port 8788
3. Are you developing on Windows? The current version of wrangler2 has a problem with path handling, see: https://github.com/cloudflare/wrangler2/issues/51 (The workaround proposed in the issue works)tdep
12/01/2021, 9:15 AMnpx wrangler pages dev --local --proxy 8788 -- yarn start
).
This is the output from the start of the proxy (nothing seems wrong here):
Running yarn start...
[proxy]: yarn run v1.22.17
$ react-scripts start
[proxy]: warning ../../package.json: No license field
Compiling worker to "/var/folders/vf/w_c7xzcn451bxvlwnpv10_400000gn/T/functionsWorker.js"
Finished in 311ms.
[HPM] Proxy created: / -> http://127.0.0.1:65487
[HPM] Proxy created: / -> http://127.0.0.1:8788
Serving at http://127.0.0.1:8788/
[proxy]: (node:9724) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /Users/tdep/projects/marketplace-devenv/node_modules/postcss-safe-parser/node_modules/postcss/package.json.
Update this package.json to use a subpath pattern like "./*".
(Use `node --trace-deprecation ...` to show where the warning was created)
[proxy]: ℹ 「wds」: Project is running at http://x.x.x.x/
[proxy]: ℹ 「wds」: webpack output is served from
[proxy]: ℹ 「wds」: Content not from webpack is served from /Users/tdep/projects/marketplace-devenv/public
[proxy]: ℹ 「wds」: 404s will fallback to /
pinko64
12/01/2021, 10:43 AMJeremiahlee
12/01/2021, 11:08 AMWalshy | Pages
12/01/2021, 11:09 AMpinko64
12/01/2021, 11:11 AMjohanndev
12/01/2021, 2:58 PMnpx wrangler pages dev --proxy 3000 -- npx yarn start
were correct. The --proxy
argument specifies the port where your frontend-dev server is running (i.e. the your react app). Wrangler itself runs under a another port (default is 8788
), which is printed in the line: Serving at http://127.0.0.1:8788/
. This is the port where wrangler dev-server will route your requests to the respective function, and therefore the port which should be used to access you pages app.tdep
12/01/2021, 3:49 PMjschlesser
12/02/2021, 1:13 AMpinko64
12/02/2021, 7:36 AMWalshy | Pages
12/02/2021, 7:39 AMWalshy | Pages
12/02/2021, 7:39 AM