-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add @prisma/prisma-fmt-wasm
to CLI and output dependency version in -v
, use instead of Formatter Engine binary
#12496
Comments
Note: currently, installing // .---> this isn't compatible with a monorepo
// |
// ^^^^^^^^
const path = require('path').join(__dirname, 'prisma_fmt_build_bg.wasm');
const bytes = require('fs').readFileSync(path);
const wasmModule = new WebAssembly.Module(bytes);
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
wasm = wasmInstance.exports;
module.exports.__wasm = wasm; The error I get at runtime is:
|
About extracting the version of |
Something to work on with @tomhoule.
We can either implement that, or maybe use the Npm package version as an adequate replacement if that has enough information. |
This part I don't understand, I don't see what is wrong. edit to add details: this is generated code (from wasm-bindgen), so changing is possible but not very practical. |
For the version, we can implement something easily, if that's what we want. The package.json approach might be better, I don't know how JS projects do it usually. |
The issue here asks for the dependency version, so the issue @jkomyno linked to is technically not relevant unless there is a good reason not to do it that way. |
@Jolg42 suggests that we might fix the path issue following a similar approach to https://github.com/prisma/prisma/blob/main/helpers/compile/plugins/replaceWithPlugin.ts#L44 I will try to add it to the |
We have the same kind of error as @jkomyno posted, when trying to run node: 16.14.2
In |
@0gust1 would you please report here what's your By the way, I'm tracking this potential Wasm bundling problem here. |
@jkomyno Hi 👋 . Thanks for the follow-up! I'll open an issue (it was on my today's TODO, after my yesterday post on #15859) and/or post on #15881. Expect some news in the next 6 hours. Very quickly (those elements – and others – will be in the issue): |
i am using Azure app services and i solved this problem as bellow;
note: make sure you are in the main folder (like /home/site/wwwroot). |
@prisma/prisma-fmt-wasm exists and can replace the Formatter Engine binary usage in Prisma CLI already.
@prisma/prisma-fmt-wasm
as dependency (requires CI changes)-v
output of Prisma CLIformat
(and others) call of the Formatter Engine binary with a call to the Wasm module (in a separate PR)The text was updated successfully, but these errors were encountered: