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

Empty bindings.json file breaks build #30

Closed
2 tasks
lucsoft opened this issue Nov 9, 2021 · 9 comments
Closed
2 tasks

Empty bindings.json file breaks build #30

lucsoft opened this issue Nov 9, 2021 · 9 comments
Milestone

Comments

@lucsoft
Copy link

lucsoft commented Nov 9, 2021

  • When deno_bindgen errors out it creates a empty bindings.json which should be fixed
  • Marko should check before if the file is a valid json if not recreate it
@littledivy
Copy link
Member

@lucsoft I believe this was fixed in #28
Does this still happen if you use the CLI and Rust crate from the main branch?

@lucsoft
Copy link
Author

lucsoft commented Nov 9, 2021

@littledivy yes it still happens and I'm on main

@littledivy
Copy link
Member

Ah okay. Just to confirm this is how you updated to main? :-)

# Cargo.toml
[dependencies]
deno_bindgen = { git = "https://github.com/littledivy/deno_bindgen", rev = "60a6f8a" }
deno install -n deno_bindgen -f -A --unstable https://raw.githubusercontent.com/littledivy/deno_bindgen/main/cli.ts

@lucsoft
Copy link
Author

lucsoft commented Nov 9, 2021

Can confirm this still happens
i think it's a race condition or something

i can't reproduce it consistently sadly

@littledivy
Copy link
Member

littledivy commented Nov 9, 2021

Hmm I can't reproduce it.
There might be an issue with a bindings.json from previous version conflicting with main. Try rm bindings.json and see if you can reproduce it anymore.
Also a console output of the issue you're facing will be helpful.

@lucsoft
Copy link
Author

lucsoft commented Nov 9, 2021

i deleted it and it worked for some time but after some saves it breaks

and you get
called Result::unwrap() on an Err value: Error("EOF while parsing a value", line: 1, column: 0)rust-analyzermacro-error and the json file is empty

@lucsoft
Copy link
Author

lucsoft commented Nov 9, 2021

mostly when i make bigger changes like renaming the exported function

@littledivy littledivy added this to the 0.3.0 milestone Nov 14, 2021
@littledivy
Copy link
Member

I've added error handling for broken bindings.json. @lucsoft Can you still reproduce from latest main (update both crate and CLI)?

@littledivy
Copy link
Member

littledivy commented Nov 15, 2021

Released in 0.3.1

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

2 participants