Isaac McFadyen | YYZ01
03/21/2022, 12:25 PMHelpflare
03/21/2022, 12:25 PMNODE_VERSION
and a value of the version you want the build to use (for example, 16
).
- A file in your root directory called .node-version
(notice the dot) and contents of your wanted version (for example, `16`; there's no other content, just the version).
If a specific version doesn't work for you (for example, 16.14.2
) try a less specific version (like just 16
).Stigin
03/21/2022, 12:25 PMIsaac McFadyen | YYZ01
03/21/2022, 12:26 PMStigin
03/21/2022, 12:26 PMStigin
03/21/2022, 12:27 PMStigin
03/21/2022, 12:27 PM.Netcoredeveloper
03/21/2022, 7:37 PM.Netcoredeveloper
03/21/2022, 7:38 PMIsaac McFadyen | YYZ01
03/21/2022, 7:52 PMgetStaticProps
to find where you are accessing mentor.avatar_url
Isaac McFadyen | YYZ01
03/21/2022, 7:52 PMkristian
03/21/2022, 8:05 PMkristian
03/21/2022, 8:05 PMrishav
03/21/2022, 8:57 PMexport async function buildHeaders() {
return /*html*/`
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="./pub/style.css" rel="stylesheet">
</head>
`;
}
when I goto localhost:8788
my app is able to serve the style.css file. but if i goto, say, localhost:8788/posts
, it tries to serve localhost:8788/posts/pub/style.css
, which obviously doesn't exists.
How can I give a permanent location for my static files?Skye
03/21/2022, 8:59 PM./
from that link and replace it with a /
Skye
03/21/2022, 9:00 PMrishav
03/21/2022, 9:01 PMrishav
03/21/2022, 9:36 PM// functions/_middleware.js
const assetHandler = async (context) => {
const url = new URL(context.request.url);
console.log(url.pathname)
if (url.pathname.startsWith('/pub/')) {
return await context.next();
}
};
export const onRequest = [assetHandler];
However now on all my routes, I am getting an error
[pages:err] GET /posts/13: TypeError: Cannot read properties of undefined (reading 'status')
at next (C:\Users\risharan\node_modules\wrangler\pages\functions\template-worker.ts:112:50)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
What am i doing wrong?Bytesource
03/22/2022, 2:17 AM.ts
file into another one would probably work (as it does locally). Anyway, I haven't been able to find any information whatsoever on my issue.Isaac McFadyen | YYZ01
03/22/2022, 2:44 AMesbuild
, Webpack, Rollup, etc).
- Logs can be viewed from wrangler or from the dashboard.
Functions
- CI deployments via GitHub or GitLab (no others supported at the moment).
- Currently in beta, which means limited to 100k per day (you can't pay to get more, although you can fill out this form: https://docs.google.com/forms/d/e/1FAIpQLSe4N0BjIxu9AuissCAtYjXUovViXmdx2zopjzASaJi_SImJsw/viewform?usp=send_form).
- No logs at the moment, although they are planned for General Availability.
- File-based routing system. It can be overriden for more advanced cases and for bring-your-own routing libraries such as itty-router
.
- Can call next()
to get the static asset with the same name as the incoming request. Same limitations as Pages apply (25mb max size, 20k max number of static assets).
- Some frameworks support SSR for Functions (including but not limited to Remix, SvelteKit, and Nuxt so far).scsin
03/22/2022, 12:55 PMIsaac McFadyen | YYZ01
03/22/2022, 1:04 PMIsaac McFadyen | YYZ01
03/22/2022, 1:05 PMscsin
03/22/2022, 1:09 PMIsaac McFadyen | YYZ01
03/22/2022, 1:11 PMscsin
03/22/2022, 1:12 PMsimpson
03/22/2022, 1:21 PMwarflash
03/22/2022, 1:41 PMIsaac McFadyen | YYZ01
03/22/2022, 1:46 PMIsaac McFadyen | YYZ01
03/22/2022, 1:48 PM