-
-
Notifications
You must be signed in to change notification settings - Fork 230
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
[houdini] Vite plugin + Svelte not working #750
Comments
This seems to be a problem with Houdini's CJS build, but also the fact that WXT is loading the CJS version of the package. If it loaded the ESM version, it wouldn't crash like this. Specifically, here's the line in the source code that's causing problems: https://github.com/HoudiniGraphql/houdini/blob/6c5dbda72fb4b7c42dc85a3991e9705224dda080/packages/houdini/src/lib/config.ts#L24 Here's the built ESM code: Everything looks good. Here's the CJS code: And the problem is quite obvious... If
So yeah, I would say their CJS build is just broken, or this would be fixed by #297. For now, you can patch the package to get past this error: // node_modules/.pnpm/[email protected]/node_modules/houdini/build/vite-cjs/index.js
-var import_meta = {};
-var currentDir = dirname((0, import_node_url2.fileURLToPath)(import_meta.url));
+var currentDir = __dirname; Unfortunately, I don't know if that "works", your reproduction doesn't seem to use the client? The When I add a log to the I'm also getting a type error in $ why vite
devDependencies:
@wxt-dev/module-svelte 1.0.0
├─┬ @sveltejs/vite-plugin-svelte 3.1.1
│ ├─┬ @sveltejs/vite-plugin-svelte-inspector 2.1.0
│ │ └── vite 4.5.3 peer
│ ├── vite 4.5.3 peer
│ └─┬ vitefu 0.2.5
│ └── vite 4.5.3 peer
└─┬ wxt 0.18.7 peer
└── vite 5.3.1
houdini-svelte 1.2.47
├─┬ @sveltejs/kit 1.30.4
│ ├─┬ @sveltejs/vite-plugin-svelte 2.5.3
│ │ ├─┬ @sveltejs/vite-plugin-svelte-inspector 1.0.4
│ │ │ └── vite 4.5.3 peer
│ │ ├── vite 4.5.3 peer
│ │ └─┬ vitefu 0.2.5
│ │ └── vite 4.5.3 peer
│ └── vite 4.5.3 peer
└── vite 4.5.3
wxt 0.18.7
└── vite 5.3.1 WXT was created after vite 5 was released, and does not support vite 4... So I think you're out of luck :/ If you want to use houdini, you'll probably need to write a vite 5 compatible plugin. Before that, create a basic vite 5 project and see if it works there as expected. If it does, provide that reproduction here and I'll re-open this. |
Alright, after releasing #760, applying the patch I mentioned in #750 (comment), and upgrading the reproduction to v0.18.8, the plugin is running!
It's not pretty, but it is doing something lol. Still don't know if it's generating the files correctly because I'm unfamiliar with houdini, but the Looks like it's running multiple times, so you may want to control which build steps it's added to, something like this: |
Describe the bug
Using houdini vite plugin seems to fail instantly whether in dev or build mode with the following error:
Reproduction
Minimal reproduction instantly crashes on build or dev mode:
https://github.com/Arkezz/wxt-houdini
Steps to reproduce
git clone https://github.com/Arkezz/wxt-houdini
pnpm install
in the project directory.pnpm build
||pnpm dev
System Info
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: