#Why would someone import from virtual?
7 messages · Page 1 of 1 (latest)
Hi @outer sonnet. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
In Astro, you should import public APIs like actions, isInputError, and isActionError directly from the official entry point "astro:actions":
import { actions, isInputError, isActionError } from "astro:actions";
This is the documented and supported way to use these utilities. The knowledge sources do not mention or recommend importing from internal or virtual paths like "astro/actions/runtime/virtual/shared". In fact, using internal or virtual paths is discouraged, as these are not part of the public API and may change without notice, potentially breaking your code in future Astro releases.
The correct and stable approach is to always use the documented public API:
import { actions, isInputError, isActionError } from "astro:actions";
This ensures compatibility and support as described in the official documentation Actions API Reference.
I'm sorry, but the knowledge sources do not provide any valid reason or scenario where importing from "astro/actions/runtime/virtual/shared" would be recommended or necessary. Always prefer the public API imports for stability and future-proofing your code.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@outer sonnet Kapa.ai is still learning and improving, please let me know how I did by reacting below.
Let me check the knowledge base for you again. One moment! :books: