D
Deno

help

Fresh: <Head> component is not supported

Rrabbit_rabbit4/13/2023
When running deno task start with this as my pages/index.tsx file (as in the demo) I'm seeing the following error. Any ideas what might be going on?
An error occurred during route handling or page rendering. Error: <Head> component is not supported in the browser, or during suspense renders.
at Object.Head (https://deno.land/x/fresh@1.1.5/src/runtime/head.ts:15:11)
An error occurred during route handling or page rendering. Error: <Head> component is not supported in the browser, or during suspense renders.
at Object.Head (https://deno.land/x/fresh@1.1.5/src/runtime/head.ts:15:11)
import_map.json

{
"imports": {
"$fresh/": "https://deno.land/x/fresh@1.1.5/",
"kysely": "https://esm.sh/kysely@0.24.2",
"kysely-deno-postgres": "https://deno.land/x/kysely_deno_postgres@v0.4.0/mod.ts",
"preact": "https://esm.sh/preact@10.13.1",
"preact/hooks": "https://esm.sh/preact@10.13.1/hooks",
"preact/": "https://esm.sh/preact@10.13.1/",
"preact-render-to-string": "https://esm.sh/preact-render-to-string@5.2.6",
"@preact/signals": "https://esm.sh/*@preact/signals@1.1.3",
"@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.2.3",
"fresh_session": "https://deno.land/x/fresh_session@0.2.0/mod.ts",
"redis": "https://deno.land/x/redis@v0.29.2/mod.ts"
}
}
import_map.json

{
"imports": {
"$fresh/": "https://deno.land/x/fresh@1.1.5/",
"kysely": "https://esm.sh/kysely@0.24.2",
"kysely-deno-postgres": "https://deno.land/x/kysely_deno_postgres@v0.4.0/mod.ts",
"preact": "https://esm.sh/preact@10.13.1",
"preact/hooks": "https://esm.sh/preact@10.13.1/hooks",
"preact/": "https://esm.sh/preact@10.13.1/",
"preact-render-to-string": "https://esm.sh/preact-render-to-string@5.2.6",
"@preact/signals": "https://esm.sh/*@preact/signals@1.1.3",
"@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.2.3",
"fresh_session": "https://deno.land/x/fresh_session@0.2.0/mod.ts",
"redis": "https://deno.land/x/redis@v0.29.2/mod.ts"
}
}
// pages/index.tsx
import { Head } from "$fresh/runtime.ts";
import Counter from "../islands/Counter.tsx";

export default function Home() {
return (
<>
<Head>
<title>Fresh App</title>
</Head>
<div>
<img
src="/logo.svg"
width="128"
height="128"
alt="the fresh logo: a sliced lemon dripping with juice"
/>
<p>
Welcome to `fresh`. Try updating this message in the
./routes/index.tsx file, and refresh.
</p>
<Counter start={3} />
</div>
</>
);
}
// pages/index.tsx
import { Head } from "$fresh/runtime.ts";
import Counter from "../islands/Counter.tsx";

export default function Home() {
return (
<>
<Head>
<title>Fresh App</title>
</Head>
<div>
<img
src="/logo.svg"
width="128"
height="128"
alt="the fresh logo: a sliced lemon dripping with juice"
/>
<p>
Welcome to `fresh`. Try updating this message in the
./routes/index.tsx file, and refresh.
</p>
<Counter start={3} />
</div>
</>
);
}
UUUnknown User4/15/2023
2 Messages Not Public
Sign In & Join Server To View
Llcasdev4/15/2023
Does you Counter contain a Head? The code you shared should work
UUUnknown User4/15/2023
2 Messages Not Public
Sign In & Join Server To View

Looking for more? Join the community!

Recommended Posts
Is there a way to vendor npm specifier imports?> deno vendor npm:express > Vendored 0 modules into scripts/vendor directoryHow can I import with npm: specifiers through a proxy?My company blocks npmjs.com and they have setup an internal Artifactory instance. With nodejs I can Import modules from all files in directoryConsidering I have multiple ts files in a folder and all of them export the same type module. Can I Parsing Apache mime.types into dictionary Record<string, string>This code parses the official Apache `mime.types` from GitHub and creates a dictionary `Record<strinProvide own default error page in FreshHello! I'm seeing the following error ```pragma cannot be set when runtime is automatic at https:/Smoother DX using 3rd party modules written in TypeScript in the BrowserSay, for instance, I want to use the "async" standard library's Deferred implementation in some codegrpc / http2 / https in fresh.please a correct way to use grpc / http2 / https in fresh.Importing local Node.js modulesI have a local Node.js/TS package in local directory `/foo/bar/leet/package.json` – Is there any wayServer Sent Events with FreshHi! I am trying to use Server Sent Events (SSE) with fresh. I understand I should have an island thaTwind intellisense stop workingOut of the blue, intellisense stopped working even though I installed the twind and deno extensions How use namespace on Denoi am trying to use the same namespace in multiple modules but what used to work in node, doesn't worRestart Deno process on crashHello, The following Node snippet allows a script to restart on crash : ```js import { spawn } fbest practice when spawning commands that require sudo?I am building a command line utility in deno that leverages data coming from `tcpdump`. To get any mChaining Tasks and using --watchIs there a way to chain Deno tasks or something to that accord? I'd like to run esbuild from the com