General Beef 🥩
Displaying a Modal
I am trying to get a minimal example of using Bootstrap Modals, and managing that modal using state.
Here is
routes/Index.tsx
:
And here is islands/Modal.tsx
: https://paste.jlcarveth.dev/api/02dcac97-dc65-4802-ad77-81e8ac0a8de9
The modal can open and close fine. The issue is that the state of the Modal can't be controlled programatically. When I have used Bootstrap modals in the past (with React), it was as simple as adding / removing the show
class from the modal. That approach no longer seems to work.
So I try to hide / show the modal via the bootstrap API, which you can see me try in the onClick
of that close button. But the island can't seem to access the bootstrap API. I have tried importing bootstrap via npm:bootstrap
, as well as via https://esm.sh/bootstrap
In short; I want to be able to toggle the Modal on and off (visible / hidden) without having to rely on the data-bs-toggle
and data-bs-target
HTML attributes since that prevents me from managing the modal state.4 replies
Can use the --cert flag in the command line, but not in deno.json
I am trying to run my deno program with the following command:
deno run -A --cert ~/tmp/ca.crt main.ts
This works fine. However, if I put this command in my deno.json
, it can no longer find the certificate:
My deno.json
relevant line:
So why can Deno find the cert no problem if I run the command from the CLI, but not via deno.json?5 replies
Why isn't this error caught?
Basic code example:
The output when you run this is the following:
So the code within the
catch
statement isn't running, but the code after the catch statement is executed. And yet the program crashes due to an uncaught error.8 replies