-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Error: Cannot find module 'ws' #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I don't think there is any reference anywhere in the code to the ws module. Are you sure this issue is related to sql.js? |
I also have the same issue, right after installing sql.js I found a require('ws') in sql.js d=new (s?require("ws"):window.WebSocket) |
Relevant issue : fabiosantoscode/require-emscripten#1 |
I'm having this issue as well. |
I'm using webpack to build my app and I've got the same: ERROR in ./~/sql.js/js/sql.js
Module not found: Error: Cannot resolve module 'fs' in /Users/thai/Documents/CrossMIP/frame/node_modules/sql.js/js
@ ./~/sql.js/js/sql.js 4:141-154 361:205-218
ERROR in ./~/sql.js/js/sql.js
Module not found: Error: Cannot resolve module 'ws' in /Users/thai/Documents/CrossMIP/frame/node_modules/sql.js/js
@ ./~/sql.js/js/sql.js 337:113-126 342:44-57``` |
I've fixed the problem by including the sql.js lib manually in my index.html and bypassing webpack or browserify build steps. |
Same here with SystemJS and jspm. See also jspm/jspm#1108 |
Ok, the problem with the tools you use is that they look at the code for uses of |
@kripken : Any idea about this? |
Emscripten generates those conditional requires so the same output can run in node and on the web (and elsewhere). We've discussed adding compile-time options to target only one platform, but no one has written a pull request yet. |
Here is another fix for the
|
This is my way, to use webpack with sql.js The line below is added in html file, It seems that we can't build sql.js by webpack. <script src="https://unpkg.com/[email protected]/js/sql.js"></script> |
Hi,
I'm using
npm
to installsql.js
. But whenwatchify
try to bundle the app up, it will throw this error:And in the js file, I only have something like this:
I'm using a Windows 7 laptop
I really don't know how can i solve this, thanks
The text was updated successfully, but these errors were encountered: