Skip to content
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

Installing socket.io-client with webpack #3113

Closed
mjaliz opened this issue Jun 3, 2023 · 1 comment
Closed

Installing socket.io-client with webpack #3113

mjaliz opened this issue Jun 3, 2023 · 1 comment
Assignees

Comments

@mjaliz
Copy link

mjaliz commented Jun 3, 2023

Feature Description

I want to use the socketio client wtih k6. I have installed the socket.io-clinet with webpack and build a [name].bundle.js file.
But the problem is here, when I use 'web' for 'target' key in webpack config file, I get this error: document is not defined, and I know that node dose not have access to document. when I change the 'target' value to 'node', I get 'fs' error.
How can I fix this issue?
Thanks for your attention.

Suggested Solution (optional)

No response

Already existing or connected issues / PRs (optional)

No response

@imiric
Copy link
Contributor

imiric commented Jun 5, 2023

Hi, please search the issues before opening a new one.

Support for socket.io was already discussed in #1306, and there's a JS implementation that uses xk6-websockets here.

The reason you're getting those errors is because k6 does not use a browser or Node JS runtime, so some JS libraries that target these won't work in k6. See the documentation.

@imiric imiric closed this as not planned Won't fix, can't repro, duplicate, stale Jun 5, 2023
@imiric imiric added duplicate and removed feature labels Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants