Skip to content

How do I set up Nano for NodeJS? #49

Discussion options

You must be logged in to vote

https://github.com/AlenSaito1/Aureolin/compare/migrate-nanojsx

I took a look at your branch for migrating to nano-jsx.

AlenVelocity/Aureolin@72c225a

The document object initialization in this commit is done by initSSR function on nano-jsx at

https://github.com/nanojsx/nano/blob/master/src/ssr.ts#L15-L21

This initSSR is executed in the renderSSR function. The reason for the error in your application is probably that the h function is executed before the renderSSR is executed. 👀

// throw error

const App = h("div", {}, "txt");
renderSSR(App)

// ok
const App = () => h("div", {}, "txt");
renderSSR(<App />);

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@AlenVelocity
Comment options

Answer selected by AlenVelocity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants