-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
Subscriptions Transport WS module not found during npm dev but fine in npm build #940
Comments
I got mine to work https:/ais-one/vue-crud-x/tree/master/example-vite see |
Hey @ais-one , thanks for sharing. I'm currently using Villus not Apollo as the client and importing directly from Works fine after Vite Build and deployed to server. It's just the Dev mode thats the issue. |
On dev and build, I did not encounter the error with apollo... |
can you offer complete demo in codesandbox? |
This works just fine :
|
I struggled with replicating Vite in codesandbox, I could only see configs for vue 3 Although in order to replicate just add these lines to the top of App.vue after creating a Vite app. + import { SubscriptionClient } from "subscriptions-transport-ws";
const subscriptionClient = new SubscriptionClient("ws://xxxxx/graphql", {
reconnect: true,
});
const subscriptionForwarder = (operation: any) =>
subscriptionClient.request(operation); |
The Other, |
Describe the bug
Error in chrome console.
Uncaught SyntaxError: The requested module '/@modules/subscriptions-transport-ws/dist/client.js' does not provide an export named 'SubscriptionClient'
A clear and concise description of what the bug is.
During yarn dev, Vite is unable to find exports from subscriptions-transport-ws although once the project is built for production using yarn build it works fine.
Reproduction
yarn add subscriptions-transport-ws
import { SubscriptionClient } from "subscriptions-transport-ws"; into any vue file
run yarn dev
load website and go to console.
A reproduction is required unless you are absolutely sure that the the problem is obvious and the information you provided is enough for us to understand what the problem is. If a report has only vague description (e.g. just a generic error message) and has no reproduction, it will be closed immediately.
System Info
vite
version: rc4vue
version (fromyarn.lock
orpackage-lock.json
)@vue/compiler-sfc
versionLogs (Optional if provided reproduction)
vite
orvite build
with the--debug
flag.The text was updated successfully, but these errors were encountered: