infor-cloud / m3-h5-sdk

https://infor-cloud.github.io/m3-h5-sdk/
34 stars 20 forks source link

Debug in Visual Code doesn't work with node 18 #173

Open perravnborg opened 1 year ago

perravnborg commented 1 year ago

When I use node 18, my debugging of H5 SDK no longer works. The breakpoint markers are greyed out, and never hit. The general community suggests to change the package.json attribute: from: "start": "ng serve", to: "start": "ng serve --host=127.0.0.1",

But It seems to be no go for: Odin serve

Any ideas? It can't be right that I need to downgrade node to ex. 14 or 16

My package.json looks like this: { "name": "search-item", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "watch": "ng build --watch --configuration development", "test": "ng test" }, "private": true, "dependencies": { "@angular/animations": "^14.2.0", "@angular/common": "^14.2.0", "@angular/compiler": "^14.2.0", "@angular/core": "^14.2.0", "@angular/forms": "^14.2.0", "@angular/platform-browser": "^14.2.0", "@angular/platform-browser-dynamic": "^14.2.0", "@angular/router": "^14.2.0", "rxjs": "~7.5.0", "tslib": "^2.3.0", "zone.js": "~0.11.4", "@infor-up/m3-odin": "6.0.0", "@infor-up/m3-odin-angular": "6.0.0", "@angular/cdk": "^14.2.0", "@angular/material": "^14.2.0" }, "devDependencies": { "@angular-devkit/build-angular": "^14.2.11", "@angular/cli": "~14.2.11", "@angular/compiler-cli": "^14.2.0", "@types/jasmine": "~4.0.0", "jasmine-core": "~4.3.0", "karma": "~6.4.0", "karma-chrome-launcher": "~3.1.0", "karma-coverage": "~2.2.0", "karma-jasmine": "~5.1.0", "karma-jasmine-html-reporter": "~2.0.0", "typescript": "~4.7.2" } }

mly1971 commented 6 months ago

You need to change your launch.json. The url-line needs to be specified in IPV6-format. 127.0.0.1 is not supported - like this:

"configurations": [ {​​ "type": "chrome", "request": "launch", "name": "Launch Chrome against localhost", "url": "http://[::1]:8080", "webRoot": "${​​​​​​​​​workspaceFolder}​​​​​​​​​​​​​​​​" }​​​​​​​​​​​​​​​​