How to fix it googleMap flutter web - flutter

This URL refresh every time when run and debug

If you're referring to the port, you can set it using flutter run --web-port <your_port_number>
If you are using VSCode, you can create launch.json file in .vscode folder.
The contents of the launch.json can be like this:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Run (Debug)",
"program": "lib/main.dart",
"request": "launch",
"type": "dart",
"args": [
"--web-port",
"8686",
]
},
]
}
In you Google Cloud Console, you can just pass the referrer as http://localhost:8686

Related

Cannot open localhost:8080

I have tried EVERYTHING. I have no idea why I keep getting this error every time I try to run/debug a website on visual studio code. Please see attached image for the error.
Here is my launch.json:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "pwa-chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}
Error Image

Can someone give me the default launch.json in Visual Studio Code?

Ok, so I was writing some simple python code and when I ran it, It always said attached to chrome.
So to fix this problem,I went into the launch.json and accidentally removed all the code.
Can you please give me the DEFAULT launch.json please?
Python:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
]
}

Current Working Directory on vscode extensionHost launch

I did some theme development in the past and wanted to update it. Unfortunately, I didn't save my previous launch.json and it's missing functionality to open files on f5.
Only option I find is cwd, but it isn't working.
{
"version": "0.2.0",
"configurations": [
{
"name": "Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutabl5e": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
},
]
}
I am sure, I did use to open files inside vscode opened by launch task while developing a new theme. That's how I did testing for syntax highlighting (by opening different files on launch inside of the vscode with developed extension )...
What's changed and how to make it work again?
So... to open file or folder in vscode you need to provide it as last argument for args. In my case, launch.json will looks like this:
{
"version": "0.2.0",
"configurations": [
{
"name": "Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--disable-extensions",
"${workspaceFolder}/examples"
],
},
]
}

Setting outFiles in Visual Studio Code

How do I set outfiles in Visual Studio Code? I am told this is required to speed up the Chrome Debugger. At present it takes the debugger about 3-5 minutes of just hanging there to when VSCode actually stops on the breakpoint.
I have js files in several folders in my root directory where index.html resides. The folders in the root directory include: General, MyProject, ... etc
This is my launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "pwa-chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://127.0.0.1:5500/index.html",
"webRoot": "${workspaceFolder}"
}
]
}

How to debug Quasar Electron App with VS Code

I'm having a hard time configuring vs code to debug an electron app.
What I'm trying to do is to build the project with the -d option to generate the debug (https://quasar.dev/quasar-cli/cli-documentation/commands-list#build)
And then using the following vscode launch config:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"sourceMaps": true,
"cwd": "${workspaceRoot}",
"name": "Electron Main",
// "preLaunchTask": "npm: quasar build -m electron",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
"windows": {
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd"
},
"args" : ["."],
"outputCapture": "std",
"program": "${workspaceFolder}/dist/electron/UnPackaged/electron-main.js"
}
]
}
This doesn't work. The program starts but every breakpoint gets "unverified" and it is not hit. Probably because, as far as I know, quasar uses babel to transpile files or something like that. I think I'm missing some configs. Any ideas how can I debug it?