We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello, I am using Next.js to make an app and I am trying to connect to my account using WebSocket.
Here is my code (frontend React)
export const HomeFeed = () => { const [posts, setPosts] = useState<Entity.Status[]>([]); useEffect(() => { const client = generator( "pleroma", "wss://fedi.cpluspatch.com", process.env.NEXT_PUBLIC_ACCESS_TOKEN, ); const stream: WebSocketInterface = client.userSocket() stream.on("connect", () => { console.log("connect"); }); stream.on("parser-error", (err: Error) => { console.error(err); }); }, []); return ... };
Here is my Webpack config:
webpack: (config) => { config.resolve.fallback = { net: false, tls: false, dns: false, zlib: false, fs: false, stream: require.resolve('stream-browserify'), events: require.resolve('events'), buffer: require.resolve('buffer'), url: require.resolve('url'), http: require.resolve('stream-http'), https: require.resolve('https-browserify'), crypto: require.resolve('crypto-browserify'), querystring: require.resolve('querystring-es3'), os: require.resolve('os-browserify/browser'), assert: require.resolve('assert') } return config; }
The error I am getting is "TypeError: invalid 'instanceof' operand URL" at line const stream: WebSocketInterface = client.userSocket()
const stream: WebSocketInterface = client.userSocket()
Here is my stack trace: https://pastebin.com/v5hkQN0Y
Am I doing something wrong?
The text was updated successfully, but these errors were encountered:
Hmm, I'm not sure. Your code seems good.
Sorry, something went wrong.
This has happened several times with different projects
No branches or pull requests
Hello, I am using Next.js to make an app and I am trying to connect to my account using WebSocket.
Here is my code (frontend React)
Here is my Webpack config:
The error I am getting is "TypeError: invalid 'instanceof' operand URL" at line
const stream: WebSocketInterface = client.userSocket()
Here is my stack trace: https://pastebin.com/v5hkQN0Y
Am I doing something wrong?
The text was updated successfully, but these errors were encountered: