W
Waspβ€’12mo ago
Harish

Getting Wasp Compilation Error since Yesterday

Hi Team, We've been working on a SaaS product using Wasp, and everything was fine until last Friday. Since yesterday, our GitHub CI builds started to fail during project compilation. Can anyone help us resolve this? Below is the error message. The failure is happening while running the "wasp test client run --silent" command: [Client!] npm WARN deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead 🐝 --- Starting compilation and setup phase. Hold tight... ------------------------ 🐝 --- Compiling wasp project... -------------------------------------------------- 🐝 --- Starting npm install... ---------------------------------------------------- ...Still installing npm dependencies! ...Installation going great - we'll get there soon! ...The installation is taking a while, but we'll get there! [Server]> server@0.0.0 postinstall [Server]> patch-package [Server] [Server]patch-package 6.5.1 [Client!] npm WARN deprecated domexception@4.0.0: Use your platform's native DOMException instead [Server!] ERROR Failed to apply patch for package oauth at path [Server!] [Server!] node_modules/oauth [Server!] [Server!] This error was caused because oauth has changed since you [Server!] made the patch file for it. This introduced conflicts with your patch, [Server!] just like a merge conflict in Git when separate incompatible changes are [Server!] made to the same piece of code. [Server!] [Server!] Maybe this means your patch file is no longer necessary, in which case [Server!] hooray! Just delete it! [Server!] [Server!] Otherwise, you need to generate a new patch file. [Server!] [Server!] To generate a new one, just repeat the steps you made to generate the first [Server!] one. [Server!] i.e. manually make the appropriate file changes, then run [Server!] patch-package oauth [Server!] Info: [Server!] Patch file: patches/oauth+0.9.15.patch [Server!] Patch was made for version: 0.9.15 [Server!] Installed version: 0.10.0
18 Replies
Harish
HarishOPβ€’12mo ago
Rest of the error message is pasted below due to character restriction: [Server!] patch-package finished with 1 error(s). [Server!] npm ERR! code 1 [Server!] npm ERR! path /home/runner/work/captn-web-ui/captn-web-ui/app/.wasp/out/server [Server!] npm ERR! command failed [Server!] npm ERR! command sh -c patch-package [Server!] [Server] Applying patches... [Client] added 598 packages, and audited 599 packages in 28s [Client]
[Client] 118 packages are looking for funding [Client] run npm fund for details [Client]
[Client] found 0 vulnerabilities Error: Error] Your wasp project failed to compile: ------------------------------- - npm install failed: Setup failed! Server setup failed with exit code 1. Error: Error] Compilation of wasp project failed: -------------------------------- 1 errors found [Server!] npm ERR! A complete log of this run can be found in: /home/runner/.npm/_logs/2024-02-06T10_25_29_114Z-debug-0.log Error: Process completed with exit code 1.
matijash
matijashβ€’12mo ago
was there any change in e.g. Node version, or a similar update?
Harish
HarishOPβ€’12mo ago
Nope, there are no change in the package versions.
matijash
matijashβ€’12mo ago
@Wasp Team any ideas? Harish and the team are shipping soon and would be great to unlock them πŸ™‚
martinsos
martinsosβ€’12mo ago
Took a quick look, I am confident we can find a solution for this but I need to take a bit of time to reproduce and test solutions -> I will get back to you on this today or latest tomorrow morning with something concrete! @Harish I could use just a bit of extra information in the meantime: which Wasp version are you using? Which authentication methods are you using?
Harish
HarishOPβ€’12mo ago
Hi @martinsos : We are using "wasp version 0.11.8 (latest)", "node: v18.19.0" and for authentication We are using Google Social Auth
martinsos
martinsosβ€’12mo ago
@Harish , I investigated a bit, and the problem is following: - We, in internal Wasp code (the one gnerated for the server), are applying a patch to oauth library, verison 0.9.15, to fix a small bug it has. - However, oauth 0.10 was released, and one of packages we use in our code pulls in this new version of oauth 0.10 and the logic for applying the patches complains that it can't complain this aptch because it is for old version. This is not really a problem, because oauth 0.10 has the problem that patch was fixing already fixed, so the patch not being applied is actually good, but patch-package, which we are using to appl the patch, is not happy with that when being run in CI -> in CI it will throw an error, just to be safe. Quick and dirty solution is to delete the patch file. On your CI server, following command should give you the locatoin of thta patch file, where wasp installs it on your machine:
PATCH_FILE_PATH=$(cat $(whereis wasp | cut -d " " -f 2) | tail -1 | cut -d " " -f 1 | cut -d "=" -f 2)/Generator/templates/server/patches/oauth+0.9.15.patch
PATCH_FILE_PATH=$(cat $(whereis wasp | cut -d " " -f 2) | tail -1 | cut -d " " -f 1 | cut -d "=" -f 2)/Generator/templates/server/patches/oauth+0.9.15.patch
If you then do echo $PATCH_FILE_PATH, you should see something like /home/martin/.local/share/wasp-lang/0.12.0-rc1/data/Generator/templates/server/patches/oauth+0.9.15.patch. Then, you can just run rm $PATCH_FILE_PATH. You should run this on your CI server, after installation of Wasp. I would first run this on Github CI without doing rm, just with echo, to verify the obtained location makes sense. THen, if that is looking fine, you can replace echo with rm, and you should have it working. We will in the meantime look into providing a proper solution, but this should get you unstuck at the moment.
Harish
HarishOPβ€’12mo ago
@martinsos : Thanks for the workaround. Will give it a try later today and get back to you.
MEE6
MEE6β€’12mo ago
Wohooo @Harish, you just became a Waspeteer level 1!
Harish
HarishOPβ€’12mo ago
@martinsos : Were you able to make the CI pass with the workaround?
martinsos
martinsosβ€’12mo ago
@Harish I didn't have time at the moment to set it up to test it yet unfortunately, but I am pretty confident if it will work. If it doesn't it won't mess anything up for you so no risk there.
Harish
HarishOPβ€’12mo ago
@martinsos : I gave the workaround a quick try. It did printed the patch file path as expected and i removed it: /home/runner/.local/share/wasp-lang/0.11.8/data/Generator/templates/server/patches/oauth+0.9.15.patch But the next command cd app && wasp test client run --silent gave the following error and the CI fails. wasp-bin: /home/runner/.local/share/wasp-lang/0.11.8/data/Generator/templates/server/patches/oauth+0.9.15.patch: openBinaryFile: does not exist (No such file or directory) :bee: --- Starting compilation and setup phase. Hold tight... ------------------------ :bee: --- Compiling wasp project... -------------------------------------------------- So was wondering if I we need to additional step.
martinsos
martinsosβ€’12mo ago
ah, sorry about that -> giving me a second to think about this
Harish
HarishOPβ€’12mo ago
Sure, thanks
martinsos
martinsosβ€’12mo ago
Ok, yup this won't work, but I think I have another quick workaround that will work, I just need a couple of minutes to try it out. Ok, here we go again! So now we want to go with the two following lines instead:
PATCH_FILE_PATH=$(cat $(whereis wasp | cut -d " " -f 2) | tail -1 | cut -d " " -f 1 | cut -d "=" -f 2)/Generator/templates/server/package.json

sed -i 's/"postinstall": "patch-package"/"postinstall": ""/' $PATCH_FILE_PATH
PATCH_FILE_PATH=$(cat $(whereis wasp | cut -d " " -f 2) | tail -1 | cut -d " " -f 1 | cut -d "=" -f 2)/Generator/templates/server/package.json

sed -i 's/"postinstall": "patch-package"/"postinstall": ""/' $PATCH_FILE_PATH
Let me know if this works, I think it should. If not, I will prepare a more complete solution tomorrow.
Harish
HarishOPβ€’12mo ago
Sure, please give me a few mins @martinsos : The fix is working. Thanks a lot πŸ™‚
martinsos
martinsosβ€’12mo ago
Awesome! I also created an issue on GH for us to properly fix this https://github.com/wasp-lang/wasp/issues/1724, so you can watch that one to be aware of twhen proper solution comes, so you can remove these two lines from CI.
GitHub
Issues Β· wasp-lang/wasp
The fastest way to develop full-stack web apps with React & Node.js. - Issues Β· wasp-lang/wasp
Harish
HarishOPβ€’12mo ago
Sure, Thanks a lot for your quick response πŸ™‚

Did you find this page helpful?