Hello, World! I have made a Chrome plugin using Ko...
# javascript
b
Hello, World! I have made a Chrome plugin using Kotlin/JS a while ago, and I'm in the process of maintaining/adding a feature. My first step was to update the dependencies, and while I'm at it, I've also switched to the
IR
compiler - and unfortunately I experience some errors at runtime. Calling some APIs result in "No matching signature" errors
Copy code
TypeError: Error in invocation of bookmarks.create(bookmarks.CreateDetails bookmark, optional function callback): No matching signature.
I know
IR
is still beta but wondering if that rings a bell to anyone. (Not sure how easy it would be for me to create a simple repo project)
👀 2
ok I found the problem! 🎉 In the
IR
generated js code I see this at the top:
Copy code
// ...
  var create = chrome.alarms.create;
// ...
  var create = chrome.bookmarks.create;
which of course is going to be a source of problems later (ahhh JavaScript, declaring 2 var with the same name is legal...) Looking a the
Legacy
generated code, I see this instead:
Copy code
// ...
  var create = chrome.alarms.create;
// ...
  var create_0 = chrome.bookmarks.create;
Legacy was smart enough to give them different names 🙂 Will open an issue.