Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSR docs #95

Open
nichoth opened this issue Sep 23, 2022 · 0 comments
Open

SSR docs #95

nichoth opened this issue Sep 23, 2022 · 0 comments
Labels
QUESTION Further information is requested

Comments

@nichoth
Copy link
Contributor

nichoth commented Sep 23, 2022

current docs are here: https://tonicframework.dev/#ssr

It would be good to make an example of SSR. The site says to look at the docs website. I see there is a prerender function call.

However, when I make an example using prerender, it throws an error

demonstration main % node ./ssr/greeting.js 
/Users/nick/code/demonstration/node_modules/tonic-ssr/node_modules/@socketsupply/tonic/index.js:47
      const html = this.outerHTML.replace(this.innerHTML, '...')
                                  ^

TypeError: Cannot read properties of undefined (reading 'replace')
    at MyGreeting._checkId (/Users/nick/code/demonstration/node_modules/tonic-ssr/node_modules/@socketsupply/tonic/index.js:47:35)
    at MyGreeting.get state [as state] (/Users/nick/code/demonstration/node_modules/tonic-ssr/node_modules/@socketsupply/tonic/index.js:54:18)
    at new MyGreeting (/Users/nick/code/demonstration/ssr/greeting.js:9:14)
    at main (/Users/nick/code/demonstration/ssr/greeting.js:30:22)
    at Object.<anonymous> (/Users/nick/code/demonstration/ssr/greeting.js:35:1)
    at Module._compile (node:internal/modules/cjs/loader:1126:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
    at Module.load (node:internal/modules/cjs/loader:1004:32)
    at Function.Module._load (node:internal/modules/cjs/loader:839:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)

The docs website I think is a little too complex for example purposes.

@nichoth nichoth added the QUESTION Further information is requested label Sep 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
QUESTION Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant