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

Better error messages in the logs when there is parsing error or miss matched variable names #1373

Open
ddehghan opened this issue Jan 25, 2025 · 5 comments

Comments

@ddehghan
Copy link

it seems to be running but i get this warning.

BAML version "0.73.4"
vscode is up-to-date

Let me know what additional data you need.

`

Initialized BAML runtime logging as log::WARN
cant load webcrypto TypeError: Cannot set property crypto of # which has only a getter
at src/server.ts (/Users/david/.vscode/extensions/boundary.baml-extension-0.73.4/language-server/out/bin.js:18739:25)
at __init (/Users/david/.vscode/extensions/boundary.baml-extension-0.73.4/language-server/out/bin.js:10:56)
at src/cli.ts (/Users/david/.vscode/extensions/boundary.baml-extension-0.73.4/language-server/out/bin.js:18754:5)
at __init (/Users/david/.vscode/extensions/boundary.baml-extension-0.73.4/language-server/out/bin.js:10:56)
at Object. (/Users/david/.vscode/extensions/boundary.baml-extension-0.73.4/language-server/out/bin.js:18760:1)
at Module._compile (node:internal/modules/cjs/loader:1484:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1564:10)
at Module.load (node:internal/modules/cjs/loader:1295:32)
at Module._load (node:internal/modules/cjs/loader:1111:12)
at c._load (node:electron/js2c/node_init:2:16955)
Server-side -- startServer()
Starting Baml Language Server...
Server-side -- listening to connection
[Info - 12:38:23 AM] Extension 'baml-extension': 0.73.4
initialized
Upserting file: file:///xxxxxxxxx/service/api/baml_src/pageClassifierIsIt.baml. current projects 0 {}
Upserting file: file:///xxxxxxxxx/service/api/baml_src/PageDescriber.baml. current projects 0 {}
Upserting file: file:///xxxxxxxxx/service/api/baml_src/patientClinical.baml. current projects 0 {}
projects 0: {},
projects 1: {},
projects 1: {},
projects 1: {},
projects 1: {},
projects 1: {},
configResponse {
"cliPath": null,
"generateCodeOnSave": "always",
"restartTSServerOnSave": false,
"enablePlaygroundProxy": true,
"fileWatcher": false,
"trace": {
"server": "off"
},
"bamlPanelOpen": false
}
configResponse {
"cliPath": null,
"generateCodeOnSave": "always",
"restartTSServerOnSave": false,
"enablePlaygroundProxy": true,
"fileWatcher": false,
"trace": {
"server": "off"
},
"bamlPanelOpen": true
}
configResponse {
"cliPath": null,
"generateCodeOnSave": "always",
"restartTSServerOnSave": false,
"enablePlaygroundProxy": true,
"fileWatcher": false,
"trace": {
"server": "off"
},
"bamlPanelOpen": false
}
requesting diagnostics
saving urifile:///xxxxxxxxx/service/api/baml_src/patientClinical.baml /xxxxxxxxx/service/api/baml_src/patientClinical.baml
Saving file: file:///xxxxxxxxx/service/api/baml_src/patientClinical.baml
baml config {
"cliPath": null,
"generateCodeOnSave": "always",
"restartTSServerOnSave": false,
"enablePlaygroundProxy": true,
"fileWatcher": false,
"trace": {
"server": "off"
},
"bamlPanelOpen": false
}
outputdir /xxxxxxxxx/service/api/baml_client
relative output dir ../baml_client
tmpdir /xxxxxxxxx/service/api/baml_client.tmp
out dir exists
baml/message{
"type": "info",
"message": "BAML client generated! (took 18ms)"
}
projects 1: {},
requesting diagnostics
configResponse {
"cliPath": null,
"generateCodeOnSave": "always",
"restartTSServerOnSave": false,
"enablePlaygroundProxy": true,
"fileWatcher": false,
"trace": {
"server": "off"
},
"bamlPanelOpen": true
}
requesting diagnostics
requesting diagnostics
requesting diagnostics
requesting diagnostics
requesting diagnostics
`

@hellovai
Copy link
Contributor

Thank you for reporting!

is this VSCode or Cursor? We'll confirm and what OS are you on?

@aaronvg
Copy link
Contributor

aaronvg commented Jan 25, 2025

That is just a warning, so it should be fine (it s a known warning log). are you able to run tests?

@ddehghan
Copy link
Author

VSCode. I you want to look at my machine just ping me on slack.

@ddehghan
Copy link
Author

I found the issue. it was in my own code. But the error messages you guys have doesn't give me any indication of where the problem is. I found it randomly. So I am going to change the title for better error message.

in the test I was calling a name that does not exist. PageReferralOld.

it would be very helpful if you can log the error in the log. You already highlight the issue in vscode but somehow I did not see that last night.

It happed just as BAML code was updated to new version so I assumed it was in your code and was looking for an answer in BAML logs

'''
function PageReferral(page: image) -> BAML_Referral {
client CustomFast
prompt #"
{{ page }}

Some prompt ......

{{ ctx.output_format }}

"#
}

test Simple2 {
functions [PageReferralOld]
args {
page {
file "../../../public/data/699032/images/page_1.png"
}
}
}
'''

@ddehghan ddehghan changed the title vscode extension bug Better error messages when there is parsing error or miss matched variable names. Jan 25, 2025
@ddehghan ddehghan changed the title Better error messages when there is parsing error or miss matched variable names. Better error messages in the logs when there is parsing error or miss matched variable names Jan 25, 2025
@aaronvg
Copy link
Contributor

aaronvg commented Jan 26, 2025

Ahh nice catch, we'll make an improvement here. Thanks for taking the time to report this

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

3 participants