Skip to content
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

swa-cli.config.json "run" field <undefined>when "npm run vite:dev". Vite never runs #800

Open
hthaigler opened this issue Feb 6, 2024 · 0 comments

Comments

@hthaigler
Copy link

hthaigler commented Feb 6, 2024

Before filing this issue, please ensure you're using the latest CLI by running swa --version and comparing to the latest version on npm.

Are you accessing the CLI from the default port :4280 ?

[ ] No, I am using a different port number (--port) and accessing the CLI from that port
[✅] (https://emojipedia.org/check-mark-button) Yes, I am accessing the CLI from port :4280

Make sure you are accessing the URL printed in the console when running swa start!

ℹ️ NOTE: Make sure to enable debug logs when running any swa commands using --verbose=silly

Describe the bug
A clear and concise description of what the bug is.

When running swa start the webapp frontend is never run. When looking at the logs, the run command is . The cli times out waiting for http://localhost:3000 since the run command is undefined and the vite is never run.

swa-cli.config.json

{
    "$schema": "https://aka.ms/azure/static-web-apps-cli/schema",
    "configurations": {
        "bgpreconbasecamp": {
            "appLocation": "webapp",
            "outputLocation": "dist",
            "appBuildCommand": "npm run vite:build",
            "run": "npm run vite:dev",
            "appDevserverUrl": "http://localhost:3000"
        }
    }
}

To Reproduce
Steps to reproduce the behavior:

  1. Go to swa-cli.config.json and copy in json object above.
  2. Type in command swa start --verbose=silly
  3. Scroll down to logs
  4. See error:
- commands:
  - swa: node "C:\Users\<USER>\AppData\Roaming\nvm\v18.19.0\node_modules\@azure\static-web-apps-cli\dist\msha\server.js"
  - api: <undefined>
  - dataApi: <undefined>
  - run: <undefined>

Expected behavior
A clear and concise description of what you expected to happen.

Frontend should run with command npm run vite:dev and serve to http://localhost:3000

Desktop (please complete the following information):

  • OS: [e.g. iOS] Microsoft Windows 11
  • Version [e.g. 22] 10.0.22621 Build 22621
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant