arcjet / arcjet-js

Arcjet JS SDKs. Bot detection, rate limiting, email validation, attack protection, data redaction for Node.js, Next.js, Deno, Bun, Remix, SvelteKit, NestJS.
https://arcjet.com
Apache License 2.0
296 stars 8 forks source link

Investigate SvelteKit deployment adapters #886

Open blaine-arcjet opened 5 months ago

blaine-arcjet commented 5 months ago

We should try out various SvelteKit deployment adapters to make sure the integration works across them.

maietta commented 5 months ago

I'm running into this:

Cannot find package '$env' imported from /path/to/node_modules/@arcjet/sveltekit/index.js

I don't know if I should open a new issue for this or not since you mentioned the need to investigate SvelteKit deployments.

For the record, I am deploying using svelte-adapter-bun and the Bun runtime on the server side. Specifically, version 1.1.13 at the time of this writing.

davidmytton commented 5 months ago

Thanks for the report @maietta. I've been able to reproduce this with both Bun and Node, so it looks like a broader issue. I've logged https://github.com/arcjet/arcjet-js/issues/982 and we'll look into it on Monday.

blaine-arcjet commented 5 months ago

@maietta Please try out 1.0.0-alpha.17 which switched from importing the $env/dynamic/private module to using process.env. I hope it works because I couldn't actually find the SvelteKit code that disallowed $env/dynamic/private 🙈

maietta commented 5 months ago

Thank you, @blaine-arcjet . I will do that now and report back.

Update:

Using the API endpoint example for SvleteKit found here:

https://docs.arcjet.com/get-started/sveltekit

It's working perfectly with 1.0.0-alpha.17.

Thank you very, very much. I'm working to launch my website this week, so the timing is great!