Bundle && remove error!
opened this issue · comments
Hi!
i really liked your project and i would like to take it to my backend arsenal!
But i find two errors.
-
If i run your example with import from https://deno.land/x/dndb@0.2.2/mod.ts - everything works fine!
but if i made bundle with command "deno bundle https://deno.land/x/dndb@0.2.2/mod.ts dndb.js" and start again - i see this error.
https://user-images.githubusercontent.com/75129392/102415925-5d273c80-403c-11eb-80a5-f50f4c94c6c2.jpg -
await remove({ _id: 'id2' })
dont work!
https://user-images.githubusercontent.com/75129392/102416130-995a9d00-403c-11eb-809d-f5345df8e02e.jpg
Hi @michailVestnik, I ask you to include the steps to reproduce and please specify what version of deno you are using, please.
- I'm testing right now and I can't see anything wrong doing a bundle:
deno bundle --unstable https://deno.land/x/dndb@0.2.2/mod.ts dendb.js
deno run -A index.js
I also checked the bundle and I don't see anything like __default8
, so I can imagine that if you didn't get any error messages bundling without the --unstable
flag, then you are using an outdated version of deno (maybe). Check that please.
- You're right on the README example
await remove({ _id: 'id2' })
is a documentation typo. I'll fix it later, but thanks for noticing. By now you can useawait db.remove({ _id: 'id2' })
. If you want to destructure your datastore you can do:const { remove } = db;
I'll let this open for now, if you think that something is still wrong, please tell me.
Hi!
I use latest deno 1.6.1
-
I made bundle "deno bundle --unstable https://deno.land/x/dndb@0.2.2/mod.ts dendb.js" and see this error
screenshot: https://user-images.githubusercontent.com/75129392/102579246-72d15a80-413f-11eb-9a17-599a0be59d66.jpg -
If we look at this line we'll see this:
https://user-images.githubusercontent.com/75129392/102579347-aca26100-413f-11eb-9dc3-1ccf48bb0b41.jpg -
I delete this 8 constants and everithing is work fine!
I don't understand why my bundle is going like this...
That's weird, but I confirm that bundling with 1.6.1 adds these constants to the bundle, and wasn't doing it in 1.5.x, so I can assume the problem is in Deno's bundler itself. If you want to bundle smoothly, do it against 1.5.x or remove these lines, maybe I can open an issue later about this.
I'm closing this issue and tagging it as a good first issue, thanks.