evanw / evanw/emscripten-library-generator

Unsupported non-pure initializer in .\index.js on line 1

Open
#6 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
40
Forks
10
PR merge metrics
No merged PRs in 30d

Description

I'm trying to use a .JS file in unity and it contains websockets implementation. and the way to get websockets is:

var WebSocket = require('ws');

But this line causes the Liberary build to fail and provides following errors:

Unsupported non-pure initializer in .\index.js on line 1
Initialize variables in a function and invoke it from inside main()

I'm new to JS and I dont know how to invoke it inside main(). Can you please help me.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.