document not defined error when trying to use twind #226
-
I went through the getting started process using the docs, but now I've tried to add in twind the same way I see it being used in the site for the docs. Here is the full repo. The error is happening on line 87 of the routes/blog/[slug].tsx file https://github.com/briancbarrow/fresh-blog/blob/main/routes/blog/%5Bslug%5D.tsx Here is the full error:
If I comment out the
and remove the class from the jsx markup, then I get no errors. I'm just not sure where I'm messing up that it isn't working. In the utils/twind.ts file I logged out the objects coming from the twind imports and they log out just fine. So I know that the import is working correctly. But when I try to call the |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Figured it out. I hadn't added a page that adds all the styles for twind. You can see it here https://github.com/briancbarrow/fresh-blog/blob/main/routes/_render.ts |
Beta Was this translation helpful? Give feedback.
-
I have the same problem error: ReferenceError: document is not defined
at mt (https://esm.sh/v86/[email protected]/deno/twind.js:3:16536)
at wt (https://esm.sh/v86/[email protected]/deno/twind.js:3:16687)
at Bt (https://esm.sh/v86/[email protected]/deno/twind.js:3:30247)
at r (https://esm.sh/v86/[email protected]/deno/twind.js:3:31251)
at t (https://esm.sh/v86/[email protected]/deno/twind.js:3:31215)
at Vt.tw.Object.defineProperties.theme.get.o (https://esm.sh/v86/[email protected]/deno/twind.js:3:31315)
at dataToJSX (file:///home/mble/MEGA/Code/repos/mbledkowski/antipixel-website/src/mixins/dataToJSX.ts:15:33)
at dataToJSX (file:///home/mble/MEGA/Code/repos/mbledkowski/antipixel-website/src/mixins/dataToJSX.ts:22:37)
at file:///home/mble/MEGA/Code/repos/mbledkowski/antipixel-website/src/mixins/dataToJSX.ts:54:36
Watcher Process finished. Restarting on file change... |
Beta Was this translation helpful? Give feedback.
-
I have to say I don't understand what's wrong and don't know which line of your repo might be a fix that would work for me. It seems I am doing everythign similarly enough... |
Beta Was this translation helpful? Give feedback.
Figured it out. I hadn't added a page that adds all the styles for twind. You can see it here https://github.com/briancbarrow/fresh-blog/blob/main/routes/_render.ts