question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue using `useDeno` in 0.3.0

See original GitHub issue

Throws:

TypeError: Cannot read property 'value' of undefined
    at http://localhost:8080/_aleph/-/deno.land/x/aleph@v0.3.0-alpha.6/framework/react/hooks.js:88:28
    at mountMemo (http://localhost:8080/_aleph/-/cdn.esm.sh/v15/react-dom@17.0.1/esnext/react-dom.development.js:12623:33)
    at Object.useMemo (http://localhost:8080/_aleph/-/cdn.esm.sh/v15/react-dom@17.0.1/esnext/react-dom.development.js:12930:36)
    at useMemo2 (http://localhost:8080/_aleph/-/cdn.esm.sh/v15/react@17.0.1/esnext/react.development.js:1104:35)
    at useDeno (http://localhost:8080/_aleph/-/deno.land/x/aleph@v0.3.0-alpha.6/framework/react/hooks.js:54:12)
    at App (http://localhost:8080/_aleph/app.a3093224d.js:21:5)
    at renderWithHooks (http://localhost:8080/_aleph/-/cdn.esm.sh/v15/react-dom@17.0.1/esnext/react-dom.development.js:12007:32)
    at mountIndeterminateComponent (http://localhost:8080/_aleph/-/cdn.esm.sh/v15/react-dom@17.0.1/esnext/react-dom.development.js:14188:29)
    at beginWork (http://localhost:8080/_aleph/-/cdn.esm.sh/v15/react-dom@17.0.1/esnext/react-dom.development.js:14987:36)
    at HTMLUnknownElement.callCallback2 (http://localhost:8080/_aleph/-/cdn.esm.sh/v15/react-dom@17.0.1/esnext/react-dom.development.js:4265:34)

Code to reproduce:

import type { ComponentType } from 'https://esm.sh/react@17.0.1'
import React from 'https://esm.sh/react@17.0.1'
import { useDeno } from 'https://deno.land/x/aleph@v0.3.0-alpha.6/mod.ts'

export default function App({ Page, pageProps }: { Page: ComponentType<any>, pageProps: any }) {
  useDeno(() => {
    console.log('Hi')
  })
  return (
    <main>
      <Page {...pageProps} />
    </main>
  )
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:19 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
juanvillacortaccommented, Feb 7, 2021

I’m debugging and I found that SSR generated keys are inserted on server globalThis, but not on browser globalThis.

1reaction
ijecommented, Feb 13, 2021

@juanvillacortac yes, i also figured out, currently only use useDeno in page components will generate the ssr data, i will fix it ASAP. thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

BadResource error when file changes in watch mode #75
Using example in https://deno.com/examples/hello.js or any script. This error is produced by changing the file.
Read more >
Writing a React SSR app in Deno - DEV Community ‍ ‍
Use deno help to explore the commands on offer. We'll be using this command to run our React SSR app later on.
Read more >
How to Render React SSR with Deno and Deno Deploy - Strapi
In this guide you will learn how to render server-side React components using Deno and then deploy them from the serverless Deno Deploy....
Read more >
Concurrency in modern programming languages: TypeScript ...
Building a concurrent web server in TypeScript on Deno to compare concurrency performance with Rust, Go, JS, Kotlin, and Java.
Read more >
now-deno - npm Package Health Analysis - Snyk
Community builder for using deno on the ZEIT Now platform For more ... 0.3.0 ... To use Deno's unstable mode you can specify...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found