Cоlе
01/08/2022, 5:12 AMCоlе
01/08/2022, 5:12 AMHardAtWork
01/08/2022, 5:14 AMCоlе
01/08/2022, 5:15 AMsteranevdy
01/08/2022, 5:16 AMsteranevdy
01/08/2022, 5:16 AMCоlе
01/08/2022, 5:17 AMCоlе
01/08/2022, 5:56 AMCоlе
01/08/2022, 5:56 AMCоlе
01/08/2022, 5:56 AMlet cache = await caches.open('<name>');
it breaksCоlе
01/08/2022, 5:57 AMwrangler@alpha
Cоlе
01/08/2022, 5:57 AMCоlе
01/08/2022, 5:59 AMCompiling worker to "/tmp/functionsWorker.js"...
Compiled Worker successfully.
[pages:err] SyntaxError: Unexpected reserved word
at new Module (node:internal/vm/module:123:21)
at new SourceTextModule (node:internal/vm/module:297:5)
more stack trace, but privacyCоlе
01/08/2022, 6:01 AMHardAtWork
01/08/2022, 6:55 AMCоlе
01/08/2022, 6:58 AMCоlе
01/08/2022, 9:00 AMCоlе
01/08/2022, 9:01 AMCоlе
01/08/2022, 9:01 AMCоlе
01/08/2022, 9:02 AMhttps://c.tenor.com/ZGjJDiolyuIAAAAM/kid-puzzle.gif▾
Cоlе
01/08/2022, 9:06 AMrkusa
01/08/2022, 10:19 AMtrailingSlash
enabled, which is why in my next app dynamic routes are exported to /index.html
. I gave it a test (with trailingSlash
not enabled) and the following function works for me (it is written a bit different to yours, but I'd have thought that they both are basically the same):
js
export function onRequestGet({ env, request }) {
return env.ASSETS.fetch(
new Request(new URL("/profiles/[profile]", request.url).toString(), request)
);
}
(no rewrite: ; with rewrite: )Jaren
01/08/2022, 10:22 AMJaren
01/08/2022, 10:29 AMJaren
01/08/2022, 10:29 AMrkusa
01/08/2022, 11:40 AMDude
01/09/2022, 6:51 AMnpx wrangler pages dev "public"
also run ./functions locally?Dude
01/09/2022, 6:55 AMdfcowell
01/09/2022, 7:20 AMpublic
directory in your command? Are you using a framework, or just static assets + functions?Greg Brimble | Cloudflare Pages
01/09/2022, 11:08 AMfunctions
folder exist in the same directory that you’re running wrangler?