wasp icon indicating copy to clipboard operation
wasp copied to clipboard

Fix error during `wasp start` after `wasp start` and failing `wasp build`

Open sodic opened this issue 1 year ago • 18 comments

Version: 0.13.2. (probably post-0.12.0 and caused by https://github.com/wasp-lang/wasp/issues/1769#issuecomment-1952938100, doesn't happen with 0.11.8). OS: Linux

How to reproduce:

  1. Run wasp new something && cd something.
  2. Run wasp start and wait for it to finish.
  3. Run wasp build and see it fail because of an inappropriate database (SQLLite).
  4. Run wasp start again and see the error.

Here's how it looks in action:

$ wasp start

🐝 --- Starting compilation and setup phase. Hold tight... ------------------------


🐝 --- Compiling wasp project... --------------------------------------------------


✅ --- Successfully completed npm install. ----------------------------------------


🐝 --- Setting up database... -----------------------------------------------------


✅ --- Database successfully set up. ----------------------------------------------


🐝 --- Building SDK... ------------------------------------------------------------

wasp-bin: npx: streamingProcess: chdir: invalid argument (Bad file descriptor)

sodic avatar Apr 21 '24 16:04 sodic

Check if it got fixed by #1769

sodic avatar May 02 '24 14:05 sodic

I'm getting the same error while trying to setup opensaas. I'm following the exact instructions in the docs (installing wasp -> wasp new -> wasp start db) and then the following wasp commands fail:

$ wasp db migrate-dev

🐝 --- Compiling wasp project... --------------------------------------------------


[  Wasp  ] Starting npm installwasp-bin: npm: streamingProcess: exec: invalid argument (Bad file descriptor)
$ wasp start
🐝 --- Starting compilation and setup phase. Hold tight... ------------------------


🐝 --- Compiling wasp project... --------------------------------------------------


[  Wasp  ] Starting npm installwasp-bin: npm: streamingProcess: exec: invalid argument (Bad file descriptor)

os: Ubuntu 24.04 wasp version: 0.13.2 node version (if it's matter): 18.19.1

any idea of how can I proceed to set it up? @sodic TIA!

Rotemoyal avatar Jun 22 '24 09:06 Rotemoyal

Hey @Rotemoyal, thanks for letting us know!

It's not ideal, but you should be able to fix it by running wasp clean after any command throws this error, and then rerunning the command.

wasp clean won't delete anything important, it only cleans up the build artifacts, so no worries.

sodic avatar Jun 22 '24 10:06 sodic

@sodic thanks for your quick response! actually it didn't solve the issue:

$ wasp db migrate-dev

🐝 --- Compiling wasp project... --------------------------------------------------


[  Wasp  ] Starting npm installwasp-bin: npm: streamingProcess: exec: invalid argument (Bad file descriptor)

$ wasp clean

🐝 --- Deleting the .wasp/ directory... -------------------------------------------


✅ --- Deleted the .wasp/ directory. ----------------------------------------------


🐝 --- Deleting the node_modules/ directory... ------------------------------------


✅ --- Nothing to delete: The node_modules/ directory does not exist. -------------

$ wasp db migrate-dev

🐝 --- Compiling wasp project... --------------------------------------------------


[  Wasp  ] Starting npm installwasp-bin: npm: streamingProcess: exec: invalid argument (Bad file descriptor)

Rotemoyal avatar Jun 22 '24 11:06 Rotemoyal

Hmm, strange, must be something else then. What happens when you run npm --version?

sodic avatar Jun 22 '24 11:06 sodic

well you found it :smile: I'm working on a brand new PC and npm binary wasn't in PATH. maybe it worth checking if npm exists so the error message will be indicative? thanks A LOT for helping!!!

Rotemoyal avatar Jun 22 '24 12:06 Rotemoyal

maybe it worth checking if npm exists so the error message will be indicative?

Definitely! I just made a new issue to track it: https://github.com/wasp-lang/wasp/issues/2113

Thanks for letting us know :)

sodic avatar Jun 22 '24 12:06 sodic

Had the same issue with Ubuntu 24.04 and node 18. For me it helped to upgrade node to 20 and doing a fresh wasp new.

wozszym avatar Aug 17 '24 16:08 wozszym

Short update due to quite a bit of conversation in the issue: we still don't know the cause here, we are where we were when we opened this issue, but we also didn't try much debugging yet, since there were no more reports. It is still likely to get fixed once we do https://github.com/wasp-lang/wasp/issues/1769 . If there will be more reports, we can try going after it directly.

Martinsos avatar Aug 30 '24 16:08 Martinsos

Getting this issue too

hellwaiver avatar Sep 11 '24 06:09 hellwaiver

Getting this issue too

Did you the suggested solution: https://github.com/wasp-lang/wasp/issues/1980#issuecomment-2183976395

sodic avatar Sep 11 '24 12:09 sodic

Yes, it fixed the problem. But thought I'd report it anyway

hellwaiver avatar Sep 11 '24 15:09 hellwaiver

@hellwaiver Good thing you did :)

It helps knowing how many people run into it. Thanks!

sodic avatar Sep 19 '24 10:09 sodic

Just ran into the same issue on a fresh ubuntu 24.04 and node 18, also following the opensaas template. I got past this one by installing npm, however ran into another issue at the SDK build step:

image

I tried running wasp clean and running again, but same error.

jmcapra avatar Nov 09 '24 18:11 jmcapra

Just ran into the same issue on a fresh ubuntu 24.04 and node 18, also following the opensaas template. I got past this one by installing npm, however ran into another issue at the SDK build step:

image

I tried running wasp clean and running again, but same error.

Can you try using node version 20?

Martinsos avatar Nov 12 '24 20:11 Martinsos

I am having an issue where I am trying to deploy the app to heroku but after I generate the build and try to push to heroku app is crashing, this is the log:

node:internal/modules/cjs/loader:1051 throw err; ^

Error: Cannot find module '/usr/src/app/wasp' at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15) at Module._load (node:internal/modules/cjs/loader:901:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12) at node:internal/main/run_main_module:23:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }

Node.js v20.8.0

can somebody help with this?

steve-quadranttech avatar Nov 15 '24 10:11 steve-quadranttech

I am having an issue where I am trying to deploy the app to heroku but after I generate the build and try to push to heroku app is crashing, this is the log:

@steve-quadranttech , could you please create a separate issue for this, since I don't beleive this is associated with the current Github issue. Or maybe even better, go to our Discord server and ask this under #questions channel? That will allow us to track this properly and hopefully help.

Martinsos avatar Nov 15 '24 13:11 Martinsos

Hey @Rotemoyal, thanks for letting us know!

It's not ideal, but you should be able to fix it by running wasp clean after any command throws this error, and then rerunning the command.

wasp clean won't delete anything important, it only cleans up the build artifacts, so no worries.

This solved my issue, thanks. I ran this command first wasp clean . Then I ran wasp start

NumNine9 avatar Nov 18 '24 12:11 NumNine9

Was able to replicate the issue and the problem occurs in the third step when wasp build returns an error message. Caused the failure by using a dummy mail provider instead of an inappropriate database (SQLLite), however wasp clean solved it. 0.15.2

orotibor avatar Jan 21 '25 03:01 orotibor