How do I set up Nano for NodeJS? #49
-
Hello, I've been trying to use Nano with node, but it's throwing My {
"compilerOptions": {
"target": "es6",
"lib": [
"ESNext"
],
"module": "commonjs",
"outDir": "./dist",
"resolveJsonModule": true,
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"jsx": "react",
"jsxFactory": "Nano.h",
"forceConsistentCasingInFileNames": true,
"experimentalDecorators": true
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules",
"tests/**/*"
]
} Additional InfoWhat I'm trying to achieve is, to migrate from |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Please take a look at example1: |
Beta Was this translation helpful? Give feedback.
-
https://github.com/AlenSaito1/Aureolin/compare/migrate-nanojsx I took a look at your branch for migrating to nano-jsx. The document object initialization in this commit is done by https://github.com/nanojsx/nano/blob/master/src/ssr.ts#L15-L21 This initSSR is executed in the // throw error
const App = h("div", {}, "txt");
renderSSR(App)
// ok
const App = () => h("div", {}, "txt");
renderSSR(<App />); |
Beta Was this translation helpful? Give feedback.
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 athttps://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 theh
function is executed before therenderSSR
is executed. 👀