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

Neodrag not working when using environment variables? #53

Closed
d0x7 opened this issue May 18, 2022 · 2 comments
Closed

Neodrag not working when using environment variables? #53

d0x7 opened this issue May 18, 2022 · 2 comments

Comments

@d0x7
Copy link

d0x7 commented May 18, 2022

I just recently learned about svelte and am currently learning it. I saw a svelte summit where you held a talk and got to know your projects, that MacOS Web thing is really cool btw :)

I wanted to try neodrag, so I added it to the Svelte Realworld project that I'm using to play around with.

It worked like a charm... until I used a environment variable in my code. Neodrag seems not to generate the whole code (including classes like neodrag on the element itself) when accessing process.env.

I created a stackblitz for you, so you can easily see what I mean. What's interessting, it's not only that when I use an environment variable "inside" an element that should be draggable, but also when I just access the process.env property within a script tag.

Stackblitz Container.

Maybe you can help me to figure out what the issue is.

@PuruVJ
Copy link
Owner

PuruVJ commented May 18, 2022

Heya!! Thanks!

I checked ur demo, biggest issue is that sveltekit doesn't support process. Because process isn't there, whole code errors and stops execution, hence the imports, which are below the console.log(process..., are not executed at all.

So avoiding use of process will fix it. Instead use import.meta.env

Hope that helps

@PuruVJ
Copy link
Owner

PuruVJ commented Jun 1, 2022

Closing due to inactivity. Feel free to reopen if issue is not fixed

@PuruVJ PuruVJ closed this as completed Jun 1, 2022
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