server bug: navigator is not defined
See original GitHub issueUsecase:
import Swiper from "swiper"
export default React.createClass({
componentDidMount: function(){
const swiper = new Swiper( this.refs.container, this.props.settings );
},
});
If you try to render this on server side you’ll get: ReferenceError: navigator is not defined
Problem: Swiper is not isomorphic.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:3
- Comments:14 (1 by maintainers)
Top Results From Across the Web
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 >node.js - Fixing "ReferenceError: navigator is not defined"
I'm currently learning how to make PWA. Now I am stuck in the service worker. The logs said that navigator is not defined....
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 >NullEngine giving error, navigator not defined - Bugs
Hi, I do get a following error with the latest Babylonjs 5.0 alpha 44 when I try to run NullEngine: BJS - [23:16:58]:...
Read more >referenceerror: navigator is not defined next - You.com
Probably this package is not suitable for SSR. It seems like it calls navigator without checking availability of the browser api and it...
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 Free
Top 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
There is a sense to require it in isomorphic app, that’s not said anyone is going to init it on server. Swiper fails here
import Swiper from "swiper"
@renatogalvones this should work