Jump to content


Photo
Question

TypeError:setInteral()unref is not a function

node.js node-steam-user

  • Please log in to reply
1 reply to this topic

#1 johnnyJ

johnnyJ

    Member

  • Member
  • PipPip
  • 10 posts

Posted 10 July 2018 - 07:46 AM

I need add steam-api to my reacr prjct.First I'm running my project with npm start and then I launch steam-user with node steam-api.And when i import steam-user to my react prjct I receive this error https://imgur.com/4xqZZlb

My files:

Package.json:

{
"name": "steamx-app",
"author": "webif",
"description": "empty",
"main": "electron/main.js",
"version": "0.1.0",
"private": true,
"homepage": "./",
"scripts": {
"start": "nf start",
"steam-api": "node src/steam-api.js",
"react-start": "react-scripts start",
"electron-start": "node electron-wait-react",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"electron": "electron .",
"ebuild": "yarn build && node_modules/.bin/build"
},
"build": {
"productName": "steamX",
"appId": "com.steamx.app",
"extends": null,
"electronVersion": "2.0.4",
"files": [
"build/**/*",
"electron/*"
]
},
"dependencies": {
"electron-titlebar": "0.0.3",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-router-dom": "^4.3.1",
"react-scripts": "1.1.4",
"readline": "^1.3.0",
"steam-user": "^3.27.1"
},
"devDependencies": {
"electron": "^2.0.4",
"electron-builder": "^20.19.2",
"foreman": "^3.0.1"
}
}

steam-api.js:

const SteamUser = require('steam-user')
var client = new SteamUser()

reactjs file:

import React, { Component } from 'react'
import LoginForm from './LoginForm'
import SteamGuardForm from './SteamGuardForm'
import '../../steam-api.js'

export default class Login extends Component {
state = {
accountName: "",
password: "",
steamGuardCode: ""
}

inputChangeHandler = (event) => {
this.setState({
[event.target.id]: event.target.value
})
}

loginHandler = () => {
// sessionStorage.setItem("promptSteamGuard", true)
}

render() {
return(
<div className="welcome-container">
<LoginForm
accountName={this.state.accountName}
password={this.state.password}
inputChange={this.inputChangeHandler}
tryLogin={this.loginHandler}
/>
<SteamGuardForm
steamGuardCode={this.state.steamGuardCode}
/>
</div>
)
}
}

Edited by johnnyJ, 10 July 2018 - 07:52 AM.


#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 1,815 posts

Posted 10 July 2018 - 12:20 PM

You're not running code in the Node.js context.







Also tagged with one or more of these keywords: Question, node.js, node-steam-user

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users