Skip to content

import primus client in client JS #768

Description

@happycoder16

Version:
node 12.18.3
primus 8.0.1
ws 7.4.0

Environment:

  • Operating system:
  • windows 10
  • Browser:
  • chrome
  • Node.js:
  • 12.18.3

I am new to JS and its eco system. I used create-react-app to setup the client side, and server side is express server.
I used primus.save() to generate primus-client.js and save in the source dir. This module is then imported into client side JS which is a middleware for redux. When I start the react by "npm run start", I am getting the following errors
How can I fix this? Thank a lot.

Failed to compile.

src\client\primus-client.js
Line 264:44: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 2029:37: Unexpected use of 'self' no-restricted-globals
Line 2029:71: Unexpected use of 'self' no-restricted-globals
Line 2403:76: Unexpected use of 'self' no-restricted-globals
Line 2403:99: Unexpected use of 'self' no-restricted-globals
Line 2523:21: Unexpected use of 'location' no-restricted-globals
Line 2524:32: Unexpected use of 'location' no-restricted-globals
Line 2526:32: Unexpected use of 'location' no-restricted-globals
Line 2526:59: Unexpected use of 'location' no-restricted-globals
Line 3622:67: 'MozWebSocket' is not defined no-undef

Search for the keywords to learn more about each error.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions