Deploying Wasp/Open-SaaS to Netlify

Hello, I am a bit of a noob in deployment, so bear with my questions šŸ™ I am following the Netlify deployment guide, but when I reach the netlify build command I don't see anything being built. You can see in the attached image my file structure (it is the default one in Open-Saas), and here is the content of my netlify.toml files: app/.wasp/build/web-app/netlify.toml:
[build]
publish = ".wasp/build/"

[[redirects]]
from = "/*"
to = "/index.html"
status = 200
force = false
[build]
publish = ".wasp/build/"

[[redirects]]
from = "/*"
to = "/index.html"
status = 200
force = false
app/.wasp/build/web-app/.netlify/netlify.toml:
redirectsOrigin = "config"
plugins = []
headers = []

[functions]

[functions."*"]

[build]
publish = "/Users/rbatista19/aiblogarticles1/app/.wasp/build"
publishOrigin = "config"
base = "/Users/rbatista19/aiblogarticles1/app"
commandOrigin = "heuristics"

[build.environment]

[build.processing]

[build.processing.css]

[build.processing.html]

[build.processing.images]

[build.processing.js]

[build.services]

[[redirects]]
from = "/*"
to = "/index.html"
status = 200.0
force = false

[redirects.query]

[redirects.conditions]

[redirects.headers]
redirectsOrigin = "config"
plugins = []
headers = []

[functions]

[functions."*"]

[build]
publish = "/Users/rbatista19/aiblogarticles1/app/.wasp/build"
publishOrigin = "config"
base = "/Users/rbatista19/aiblogarticles1/app"
commandOrigin = "heuristics"

[build.environment]

[build.processing]

[build.processing.css]

[build.processing.html]

[build.processing.images]

[build.processing.js]

[build.services]

[[redirects]]
from = "/*"
to = "/index.html"
status = 200.0
force = false

[redirects.query]

[redirects.conditions]

[redirects.headers]
No description
21 Replies
kapa.ai
kapa.aiā€¢5mo ago
Hi @Ricardo Batista. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the information provided, it seems like you're trying to deploy your Wasp app's frontend to Netlify. Here are the steps you should follow according to the Wasp deployment guide (https://wasp-lang.dev/docs/advanced/deployment/manually#netlify-client): 1. Make sure you have a Netlify account and Netlify CLI (https://docs.netlify.com/cli/get-started/) installed. 2. Log in to your Netlify account via the CLI. You can check if you're logged in with netlify status, and if you're not, you can log in with netlify login. 3. Build your Wasp app. You can do this by following the instructions in the Wasp deployment guide (https://wasp-lang.dev/docs/advanced/deployment/manually#1-generating-deployable-code). 4. Navigate to the .wasp/build/web-app directory with the command cd .wasp/build/web-app. 5. Run the command npm install && REACT_APP_API_URL=<url_to_wasp_backend> npm run build, where <url_to_wasp_backend> is the URL of the Wasp server that you previously deployed. 6. Deploy the client with the command netlify deploy. 7. Follow the instructions provided by the CLI. You'll need to decide whether you want to create a new app or use an existing one, and which team your app will reside under. 8. Finally, run the command netlify deploy --prod. Your client should now be live at <https://<app-name>.netlify.app.> Please note that you should set this URL as the WASP_WEB_CLIENT_URL environment variable in your server hosting environment (e.g., Fly.io or Heroku). Regarding the issue you're facing with the netlify build command, it's worth noting that the Wasp deployment guide doesn't mention this command. Instead, it suggests using netlify deploy and netlify deploy --prod. If you're still facing issues, I recommend reaching out to the Wasp community on their Discord server (https://discord.com/channels/686873244791210014/1215566973191069696) for further assistance. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Ricardo Batista, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
Ricardo Batista
Ricardo Batistaā€¢5mo ago
I had already changed this line in app/.wasp/build/web-app/netlify.toml:
[build]
publish = "build/"
[build]
publish = "build/"
to
[build]
publish = ".wasp/build/"
[build]
publish = ".wasp/build/"
because the app/build folder didn't exist. And now I am a bit lost. The netlify build command works fine:
Ricardos-MacBook-Pro:web-app rbatista19$ netlify build
(node:54520) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

Netlify Build
ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€

āÆ Version
@netlify/build 29.39.1

āÆ Flags
dry: false
offline: false

āÆ Current directory
/Users/rbatista19/aiblogarticles1/app

āÆ Config file
/Users/rbatista19/aiblogarticles1/app/.wasp/build/web-app/netlify.toml

āÆ Context
production

Functions bundling
ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€


(Functions bundling completed in 1ms)

Save updated config
ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€


(options.onEnd completed in 2ms)

Netlify Build Complete
ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€

(Netlify Build completed in 22ms)
Ricardos-MacBook-Pro:web-app rbatista19$ netlify build
(node:54520) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

Netlify Build
ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€

āÆ Version
@netlify/build 29.39.1

āÆ Flags
dry: false
offline: false

āÆ Current directory
/Users/rbatista19/aiblogarticles1/app

āÆ Config file
/Users/rbatista19/aiblogarticles1/app/.wasp/build/web-app/netlify.toml

āÆ Context
production

Functions bundling
ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€


(Functions bundling completed in 1ms)

Save updated config
ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€


(options.onEnd completed in 2ms)

Netlify Build Complete
ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€

(Netlify Build completed in 22ms)
But when I ran the netlify deploy command, I get no errors but the Website Draft URL gives me a 404.
Ricardos-MacBook-Pro:web-app rbatista19$ netlify deploy
(node:58409) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Deploy path: /Users/rbatista19/aiblogarticles1/app/.wasp/build
Configuration path: /Users/rbatista19/aiblogarticles1/app/.wasp/build/web-app/netlify.toml
Deploying to draft URL...
ā ‹ Uploading blobs to deploy store...

Netlify Build
ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€

āÆ Version
@netlify/build 29.39.1

āÆ Flags
deployId: 66177203e957f934fe1192ad
open: false
prod: false
prodIfUnlocked: false
skipFunctionsCache: false

āÆ Current directory
/Users/rbatista19/aiblogarticles1/app

āÆ Config file
/Users/rbatista19/aiblogarticles1/app/.wasp/build/web-app/netlify.toml

āÆ Context
āœ” Finished uploading blobs to deploy store
āœ” No cached functions were found
āœ” Finished hashing
āœ” CDN requesting 2 files
āœ” Finished uploading 2 assets
āœ” Deploy is live!

Build logs: https://app.netlify.com/sites/aiblogarticles/deploys/66177203e957f934fe1192ad
Function logs: https://app.netlify.com/sites/aiblogarticles/functions?scope=deploy:66177203e957f934fe1192ad
Website draft URL: https://66177203e957f934fe1192ad--aiblogarticles.netlify.app

If everything looks good on your draft URL, deploy it to your main site URL with the --prod flag.
netlify deploy --prod
Ricardos-MacBook-Pro:web-app rbatista19$ netlify deploy
(node:58409) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Deploy path: /Users/rbatista19/aiblogarticles1/app/.wasp/build
Configuration path: /Users/rbatista19/aiblogarticles1/app/.wasp/build/web-app/netlify.toml
Deploying to draft URL...
ā ‹ Uploading blobs to deploy store...

Netlify Build
ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€

āÆ Version
@netlify/build 29.39.1

āÆ Flags
deployId: 66177203e957f934fe1192ad
open: false
prod: false
prodIfUnlocked: false
skipFunctionsCache: false

āÆ Current directory
/Users/rbatista19/aiblogarticles1/app

āÆ Config file
/Users/rbatista19/aiblogarticles1/app/.wasp/build/web-app/netlify.toml

āÆ Context
āœ” Finished uploading blobs to deploy store
āœ” No cached functions were found
āœ” Finished hashing
āœ” CDN requesting 2 files
āœ” Finished uploading 2 assets
āœ” Deploy is live!

Build logs: https://app.netlify.com/sites/aiblogarticles/deploys/66177203e957f934fe1192ad
Function logs: https://app.netlify.com/sites/aiblogarticles/functions?scope=deploy:66177203e957f934fe1192ad
Website draft URL: https://66177203e957f934fe1192ad--aiblogarticles.netlify.app

If everything looks good on your draft URL, deploy it to your main site URL with the --prod flag.
netlify deploy --prod
MEE6
MEE6ā€¢5mo ago
Wohooo @Ricardo Batista, you just became a Waspeteer level 1!
Ricardo Batista
Ricardo Batistaā€¢5mo ago
When I look at the build folder, it seems to be fairly empty
No description
Ricardo Batista
Ricardo Batistaā€¢5mo ago
Note: I am not deploying the backend
Vinny (@Wasp)
Vinny (@Wasp)ā€¢5mo ago
Hey @Ricardo Batista I think you're running the wrong command. After running wasp build , then run cd .wasp/build/web-app and after that run
npm install && REACT_APP_API_URL=<url_to_wasp_backend> npm run build
npm install && REACT_APP_API_URL=<url_to_wasp_backend> npm run build
then from there you can run netlify deploy and finally neflify deploy --prod if everything looks good you also should NOT have to change anything in the netlify.toml file
Ricardo Batista
Ricardo Batistaā€¢5mo ago
Thanks @Vinny (@Wasp) , but in the case I am not configuring a backend, it should be npm install && npm run build, right?
Vinny (@Wasp)
Vinny (@Wasp)ā€¢5mo ago
yep. but just to make sure, you have no operations in your wasp app at all?
Ricardo Batista
Ricardo Batistaā€¢5mo ago
No.
Vinny (@Wasp)
Vinny (@Wasp)ā€¢5mo ago
Open SaaS comes with many server operations built-in. In this case I guess you're just deploying the landing page then it should work without the API URL @Ricardo Batista if you want to make sure the code you're going to deploy is in a proper state, you can also run wasp clean before you run wasp build. this will reset any config files that you may have changed unknowingly in your previous attempts to deploy
Ricardo Batista
Ricardo Batistaā€¢5mo ago
Thanks @Vinny (@Wasp), just did wasp clean > wasp build > cd .wasp/build/web-app > npm install && npm run build > netlify deploy And got this:
Ricardos-MacBook-Pro:web-app rbatista19$ netlify deploy
(node:28619) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
This folder isn't linked to a site yet
? What would you like to do? Link this directory to an existing site
Git directory located in /Users/rbatista19/aiblogarticles1

netlify link will connect this folder to a site on Netlify

? How do you want to link this folder to a site? Choose from a list of your recently updated sites
Fetching recently updated sites...

? Which site do you want to link? aiblogarticles
Directory Linked

Admin url: https://app.netlify.com/sites/aiblogarticles
Site url: https://getaiblogarticles.com

You can now run other `netlify` cli commands in this directory
Deploy path: /Users/rbatista19/aiblogarticles1/app/build
Configuration path: /Users/rbatista19/aiblogarticles1/app/.wasp/build/web-app/netlify.toml
ā€ŗ Error: The deploy directory "/Users/rbatista19/aiblogarticles1/app/build" has not been found. Did you forget to run 'netlify build'?
Ricardos-MacBook-Pro:web-app rbatista19$
Ricardos-MacBook-Pro:web-app rbatista19$ netlify deploy
(node:28619) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
This folder isn't linked to a site yet
? What would you like to do? Link this directory to an existing site
Git directory located in /Users/rbatista19/aiblogarticles1

netlify link will connect this folder to a site on Netlify

? How do you want to link this folder to a site? Choose from a list of your recently updated sites
Fetching recently updated sites...

? Which site do you want to link? aiblogarticles
Directory Linked

Admin url: https://app.netlify.com/sites/aiblogarticles
Site url: https://getaiblogarticles.com

You can now run other `netlify` cli commands in this directory
Deploy path: /Users/rbatista19/aiblogarticles1/app/build
Configuration path: /Users/rbatista19/aiblogarticles1/app/.wasp/build/web-app/netlify.toml
ā€ŗ Error: The deploy directory "/Users/rbatista19/aiblogarticles1/app/build" has not been found. Did you forget to run 'netlify build'?
Ricardos-MacBook-Pro:web-app rbatista19$
Vinny (@Wasp)
Vinny (@Wasp)ā€¢5mo ago
ok give me a minute to check something out
web-app % netlify deploy
Deploy path: /Users/vincecanger/Documents/WASP/starsCounter/.wasp/build/web-app/build
Configuration path: /Users/vincecanger/Documents/WASP/starsCounter/.wasp/build/web-app/netlify.toml
web-app % netlify deploy
Deploy path: /Users/vincecanger/Documents/WASP/starsCounter/.wasp/build/web-app/build
Configuration path: /Users/vincecanger/Documents/WASP/starsCounter/.wasp/build/web-app/netlify.toml
your Deploy path seems to be incorrect. It is pointing to app/build instead of app/.wasp/build/web-app/build. can you share the contents of your netlify.toml file @Ricardo Batista ? also. can you right click the toml file and copy path and share it here also when you ran npm install && npm run build what was output to the console? ok I just tried it out on a new app and ran into the same error you have
Ricardo Batista
Ricardo Batistaā€¢5mo ago
It works now! Basically the netlify.toml file had:
[build]
publish = "build/"

[[redirects]]
from = "/*"
to = "/index.html"
status = 200
force = false
[build]
publish = "build/"

[[redirects]]
from = "/*"
to = "/index.html"
status = 200
force = false
Instead of
[build]
publish = ".wasp/build/web-app/build"

[[redirects]]
from = "/*"
to = "/index.html"
status = 200
force = false
[build]
publish = ".wasp/build/web-app/build"

[[redirects]]
from = "/*"
to = "/index.html"
status = 200
force = false
Vinny (@Wasp)
Vinny (@Wasp)ā€¢5mo ago
it looks like something changed with the new CLI from netlify
Ricardo Batista
Ricardo Batistaā€¢5mo ago
Exactly, might need to be changed in your production files
Want results from more Discord servers?
Add your server