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

Astro can't access process global #24096

Closed
EdamAme-x opened this issue Jun 4, 2024 · 7 comments
Closed

Astro can't access process global #24096

EdamAme-x opened this issue Jun 4, 2024 · 7 comments

Comments

@EdamAme-x
Copy link

EdamAme-x commented Jun 4, 2024

It can create compatibility with many frameworks.

Ex.

Deno.env.get("NODE_ENV") === process.env.NODE_ENV
@EdamAme-x
Copy link
Author

ref

/** Wrapper of Deno.env.get, which doesn't throw type error when

@bartlomieju
Copy link
Member

Can you elaborate what's the ask here?

@EdamAme-x
Copy link
Author

EdamAme-x commented Jun 4, 2024

hi @bartlomieju
Thanks for your reply.

I think node:process should be the standard global object (or optional with flag).
This should allow Astro to work fully with the Deno itself, including the hydrate process.

Astro is using node:process in global

@bartlomieju
Copy link
Member

We are not going to expose process as a global object in user code, but the NPM packages should have it available. If it doesn't work with Astro it's a bug. Do you have a reproduction that currently doesn't work correctly?

@bartlomieju bartlomieju changed the title ✡ Use process.env as Deno.env.get() Astro can't access process global Jun 4, 2024
@EdamAme-x
Copy link
Author

thanks for the reply.
It can be reproduced by creating a normal Astro app with bun and running astro dev with deno. Normally this does not happen, but if you add an integration such as react, you will get a reference error in component-render.js that the process does not exist.

@bartlomieju
Copy link
Member

bartlomieju commented Jun 4, 2024

How do you run the app? Please try running with DENO_FUTURE=1 env var set up.

@EdamAme-x
Copy link
Author

it works! thanks bro!!! @bartlomieju

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