NervJS / nerv

A blazing fast React alternative, compatible with IE8 and React 16.

Home Page:https://nerv.aotu.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nerv-server error: navigator is not defined

i-like-robots opened this issue · comments

When attempting to use nerv-server v1.3.12 in a Node environment it throws immediately:

require('nerv-server')
// throws ReferenceError: navigator is not defined

The issue is being thrown by the following line:

const isMacSafari = navigator && navigator.platform &&
/mac/i.test(navigator.platform) && /^((?!chrome|android).)*safari/i.test(navigator.userAgent)

Removing this function (it does not appear to be used) resolves the issue.