P
Prisma•4w ago
mish

Lambda missing prisma_schema_build_bg.wasm

Trying to use the new native client generation. Deploying lambda functions with SST. Received response status [FAILED] from custom resource. Message returned: Error: ENOENT: no such file or directory, open '/var/task/prisma_schema_build_bg.wasm'
2 Replies
Prisma AI Help
Prisma AI Help•4w ago
You opted for speed from this bot. Let's conjure up an answer right now! The error ENOENT: no such file or directory, open '/var/task/prisma_schema_build_bg.wasm' indicates that the required WASM file for Prisma's CLI is missing in your Lambda deployment. This file, prisma_schema_build_bg.wasm, is needed for certain Prisma operations, especially with the new native client generation. From the knowledge sources, this issue often arises due to packaging or deployment steps that do not include all necessary files. Specifically, the WASM file should be present in the correct location, but sometimes symlinks or file copies are not handled correctly during build or archive steps. For example, if you archive and extract node_modules, symlinks in .bin may be broken, causing Prisma to look for the WASM file in the wrong place or not find it at all. The file should be in node_modules/prisma/build/, not in .bin or the project root. Ensuring your deployment process preserves symlinks and includes all files is critical. One user fixed this by correcting their archive/unarchive process to preserve symlinks, or by explicitly copying the WASM file to the deployment package if needed. Another workaround is to remove and reinstall Prisma and regenerate the client as part of your deployment process to ensure all files are present and correctly linked. For AWS environments, some users added deployment steps to delete and reinstall Prisma, then run prisma generate before packaging the Lambda function, which resolved the missing file issue. Key actions: - Ensure prisma_schema_build_bg.wasm is present in node_modules/prisma/build/ in your deployment package. - If you archive/unarchive node_modules, make sure symlinks are preserved. - Consider adding deployment steps to reinstall Prisma and regenerate the client in your Lambda build process. If you continue to see this error, double-check your packaging scripts and deployment artifacts to confirm the WASM file is included and accessible at runtime. There is no mention in the knowledge sources of a specific environment variable or config to change the WASM file path for the CLI; the solution is to ensure the file is present in the expected location during deployment. References: Error when running in docker container 🤔 Alright, thanks for letting us know that there's still some help needed. A team member will reply to you shortly. In the meantime, please let us know any additional info, questions, or which parts of the answer may need clarification.
mish
mishOP•3w ago
I tried copying query_compiler_bg.wasm and prisma_schema_build_bg.wasm to the function bundle and now I get Message returned: TypeError: The "path" argument must be of type string. Received undefined which is really unhelpful

Did you find this page helpful?