GithubHelp home page GithubHelp logo

Comments (4)

MicroFish91 avatar MicroFish91 commented on June 12, 2024

Do you happen to have the Azurite extension installed? This is likely coming from the Functions extension which is running the check via the Azurite extension

from vscode-azurestaticwebapps.

davidsk avatar davidsk commented on June 12, 2024

I certainly do have the Azurite extension installed. I tried it again and this time selected the 'Debug anyway' option to see what would happen and it's a little weird.

When I run the app from the command line using the swa sdk I see this output in the terminal:

 mobile  swa start http://localhost:10000 --api-location ../api --run "npm run start"

Welcome to Azure Static Web Apps CLI (1.1.6)

***********************************************************************
* WARNING: This emulator may not match the cloud environment exactly. *
* Always deploy and test your app in Azure.                           *
***********************************************************************

[api] 
Azure Functions Core Tools
[api] Core Tools Version:       4.0.5455 Commit hash: N/A  (64-bit)
[api] Function Runtime Version: 4.27.5.21554
[api] 
[run] 
[run] > [email protected] start
[run] > gulp
[run] 
[swa] 
[swa] Found configuration file:
[swa]   C:\Dev\srdavidson\mobile\staticwebapp.config.json
[swa]
[swa] - Waiting for http://localhost:10000 to be ready
[api] [2023-12-06T20:25:40.353Z] Worker process started and initialized.
[api] 
[api] Functions:
[api]
[api]   Addresses: [GET,POST,PATCH,DELETE] http://localhost:7071/api/addresses/{id?}
[api]
[api]   Customers: [GET,POST,PATCH,DELETE] http://localhost:7071/api/customers/{id?}
[api]
[api]   Engineers: [GET,POST,PATCH,DELETE] http://localhost:7071/api/engineers/{id?}
[api]
[api]   Jobs: [GET,POST,PATCH,DELETE] http://localhost:7071/api/jobs/{id?}
[api]
[api]   TimeDataCommand: [POST,PATCH,DELETE] http://localhost:7071/api/timeDataCommand/{id?}
[api]
[api]   TimeDataQuery: [GET] http://localhost:7071/api/timeDataQuery
[api]
[api] For detailed output, run func with --verbose flag.
[run] [dumber] Starting dumber bundler v2.1.1 https://dumber.js.org
[run] [20:25:42] Using gulpfile C:\Dev\srdavidson\mobile\gulpfile.js
[run] [20:25:42] Starting 'default'...
[run] [20:25:42] Starting 'clean'...
[run] [20:25:42] Finished 'clean' after 72 ms
[run] [20:25:42] Starting 'build'...
[run] [dumber] 2.0.0-beta.8 @aurelia/dialog
[run] [dumber] 2.0.0-beta.8 @aurelia/router
[run] [dumber] 2.0.0-beta.8 @aurelia/runtime-html
[run] [dumber] 2.0.0-beta.8 aurelia
[run] [dumber] 2.6.2      tslib
[run] [dumber] 2.0.0-beta.8 @aurelia/fetch-client
[run] [dumber] 2.0.0-beta.8 @aurelia/kernel
[run] [dumber] 2.0.0-beta.8 @aurelia/metadata
[run] [dumber] 2.0.0-beta.8 @aurelia/platform
[run] [dumber] 2.0.0-beta.8 @aurelia/platform-browser
[run] [dumber] 2.0.0-beta.8 @aurelia/route-recognizer
[run] [dumber] 2.0.0-beta.8 @aurelia/runtime
[run] [dumber] 2.1.1      dumber
[run] Update index.html with entry.bundle.js
[run] [20:25:46] Write app-bundle.js
[run] [20:25:46] Write entry.bundle.js
[run] [20:25:46] Finished 'build' after 4.71 s
[run] [20:25:46] Starting 'startServer'...
[run]
[run] Dev server is started at: http://localhost:10000
[run]
[run] [20:25:46] Finished 'startServer' after 7.36 ms
[run] [20:25:46] Starting 'watch'...
[swa] ✔ http://localhost:10000 validated successfully
[swa] - Waiting for http://localhost:7071 to be ready
[swa] ✔ http://localhost:7071 validated successfully
[swa] 
[swa] Using dev server for static content:
[swa]   http://localhost:10000
[swa]
[swa] Serving API:
[swa]   C:\Dev\srdavidson\api
[swa]
[swa] Azure Static Web Apps emulator started at http://localhost:4280. Press CTRL+C to exit.

but when I use the debug launch profile I get this in a new terminal window

#Terminal Window 1

*  Executing task: npm install 


up to date, audited 5 packages in 1s

found 0 vulnerabilities
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task: func host start 


Azure Functions Core Tools
Core Tools Version:       4.0.5455 Commit hash: N/A  (64-bit)
Function Runtime Version: 4.27.5.21554

[2023-12-06T20:26:50.011Z] Debugger listening on ws://127.0.0.1:9229/cd150cf1-0c5a-4af3-bba2-24b096113779
[2023-12-06T20:26:50.014Z] For help, see: https://nodejs.org/en/docs/inspector
[2023-12-06T20:26:50.016Z] Debugger attached.
[2023-12-06T20:26:50.246Z] Worker process started and initialized.
[2023-12-06T20:26:50.433Z] Debugger attached.

Functions:

        Addresses: [GET,POST,PATCH,DELETE] http://localhost:7071/api/addresses/{id?}

        Customers: [GET,POST,PATCH,DELETE] http://localhost:7071/api/customers/{id?}

        Engineers: [GET,POST,PATCH,DELETE] http://localhost:7071/api/engineers/{id?}

        Jobs: [GET,POST,PATCH,DELETE] http://localhost:7071/api/jobs/{id?}

        TimeDataCommand: [POST,PATCH,DELETE] http://localhost:7071/api/timeDataCommand/{id?}

        TimeDataQuery: [GET] http://localhost:7071/api/timeDataQuery

For detailed output, run func with --verbose flag.

and this in a second terminal window

#Terminal Window 2

Welcome to Azure Static Web Apps CLI (1.1.6)

Using configuration "mobile" from file:
  swa-cli.config.json

***********************************************************************
* WARNING: This emulator may not match the cloud environment exactly. *
* Always deploy and test your app in Azure.                           *
***********************************************************************

[run] 
[run] > [email protected] start
[run] > gulp
[run] 
[swa] 
[swa] Found configuration file:
[swa]   C:\Dev\srdavidson\mobile\staticwebapp.config.json
[swa] 
[swa] - Waiting for http://localhost:7071 to be ready    
[swa] ✔ http://localhost:7071 validated successfully
[swa] 
[swa] Serving static content:
[swa]   C:\Dev\srdavidson\mobile
[swa] 
[swa] Using dev server for API:
[swa]   http://localhost:7071
[swa] 
[swa] Azure Static Web Apps emulator started at http://localhost:4280. Press CTRL+C to exit.

at this point I get this dialog
image

#Terminal Window 2 (cont.)

[swa] 
[swa] 
[run] [dumber] Starting dumber bundler v2.1.1 https://dumber.js.org 
[run] [20:27:04] Using gulpfile C:\Dev\srdavidson\mobile\gulpfile.js
[run] [20:27:04] Starting 'default'...
[run] [20:27:04] Starting 'clean'...
[run] [20:27:04] Finished 'clean' after 42 ms
[run] [20:27:04] Starting 'build'...
[run] [dumber] 2.0.0-beta.8 @aurelia/dialog
[run] [dumber] 2.0.0-beta.8 @aurelia/router
[run] [dumber] 2.0.0-beta.8 @aurelia/runtime-html
[run] [dumber] 2.0.0-beta.8 aurelia
[run] [dumber] 2.6.2      tslib
[run] [dumber] 2.0.0-beta.8 @aurelia/fetch-client
[run] [dumber] 2.0.0-beta.8 @aurelia/kernel
[run] [dumber] 2.0.0-beta.8 @aurelia/metadata
[run] [dumber] 2.0.0-beta.8 @aurelia/platform
[run] [dumber] 2.0.0-beta.8 @aurelia/platform-browser
[run] [dumber] 2.0.0-beta.8 @aurelia/route-recognizer
[run] [dumber] 2.0.0-beta.8 @aurelia/runtime
[run] [dumber] 2.1.1      dumber
[run] Update index.html with entry.bundle.js
[run] [20:27:09] Write app-bundle.js
[run] [20:27:09] Write entry.bundle.js
[run] [20:27:09] Finished 'build' after 4.23 s
[run] [20:27:09] Starting 'startServer'...
[run]
[run] Dev server is started at: http://localhost:10000
[run]
[run] [20:27:09] Finished 'startServer' after 9.97 ms
[run] [20:27:09] Starting 'watch'...

Two things stand out about this:

  • When running the cli, the process logs "Waiting for http://localhost:10000" but the debugger logs "Waiting for http://localhost:7071 to be ready"
  • The operations are out of sequence, the cli runs the app code first and then starts the emulator, but the debugger starts the emulator before running the app code

Having said all that, I can debug the api but unsurprisingly, I cannot debug the spa code. The launch.json file looks okay as far as I can tell.

{
    "version": "0.2.0",
    "configurations": [
    
        {
            "name": "Mobile",
            "request": "launch",
            "cwd": "${workspaceFolder}/mobile",
            "runtimeArgs": [
                "run-script",
                "start"
            ],
            "runtimeExecutable": "npm",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "type": "node",
            "serverReadyAction":{
                "action": "debugWithEdge",
                "pattern": "Dev server is started at: ([0-9]+)",
                "uriFormat": "http://localhost:%s",
                "webRoot": "${workspaceFolder}/mobile",
                "killOnServerStop": false
            }
        },
        {
            "name": "Attach to Node Functions",
            "type": "node",
            "request": "attach",
            "port": 9229,
            "preLaunchTask": "func: host start",
            "cwd":"${workspaceFolder}/api"
        }
    ]
}

from vscode-azurestaticwebapps.

nturinski avatar nturinski commented on June 12, 2024

This may be a dumb question, but the error makes me have to ask... Do you have Edge installed? I think the launch.json indicates that it's trying to debug using Edge.

from vscode-azurestaticwebapps.

AzCode-Bot avatar AzCode-Bot commented on June 12, 2024

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

from vscode-azurestaticwebapps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.