navigator is not defined
See original GitHub issueI’m try to make a isomorphic web app running on node server. I use:
import { createView as cv } from 'domvm/dist/full/domvm.full.es'
// .......
const content = cv(App, { states, update, actions, viewsMap, componentsMap, ssr: true }).html()
// ...........
where content have to be my html text string
All compile well but starting I get:
navigator is not defined
it is executed on first row of domvm function:
function DOMInstr
I’m try to do ssr by get vm.html()
and I think on node server window and his child object are not defined, so why domvm is execute DOMInstr function?
Have I do some mistake?
best regards,
Leonardo
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
node.js - ReferenceError: navigator is not defined
I assume that the problem is that Navigator.geolocation is a Web API and doesn't work on node. Is there a way to mock...
Read more >ReferenceError: navigator is not defined · Issue #522 · vercel/swr
Bug report Description / Observed Behavior When building the app with NextJS in Jenkins, the build fails with the following error message: ...
Read more >Navigator is not defined----bug - Theia Community
navigator is a browser API. If you require code in the backend that ends up executing browser scripts you will get errors.
Read more >Getting "ReferenceError: navigator is not defined" in Next.js app
Getting error - ReferenceError: navigator is not defined error from Plasmic in development and production for our NextJS app
Read more >navigator is not defined react - You.com | The AI Search ...
If you're doing server side rendering then you need to call navigator in a function that is run on the client side. For...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Do you have DEVMODE settings active. I did a quick search on the code and navigator is only used if
DEVMODE.mutations
is settrue
.Also, this is strange because
navigator
is only present in the DOMVM dev build; the full package doesn’t have any references at all. That suggests to me that, despite your import, you are somehow using the dev package.Thanks a lot @lawrence-dol and @leeoniya for your interest.
@lawrence-do help me to start my new app using domvm
the app is working
and I’m hunting the caching problem.
bets regards, Leonardo