Skip to main content

turbopack_env/
issue.rs

1use async_trait::async_trait;
2use turbo_rcstr::rcstr;
3use turbo_tasks::ResolvedVc;
4use turbo_tasks_fs::FileSystemPath;
5use turbopack_core::issue::{Issue, IssueStage, StyledString};
6
7/// An issue that occurred while resolving the parsing or evaluating the .env.
8#[turbo_tasks::value(shared)]
9pub struct ProcessEnvIssue {
10    pub path: FileSystemPath,
11    pub description: ResolvedVc<StyledString>,
12}
13
14#[async_trait]
15#[turbo_tasks::value_impl]
16impl Issue for ProcessEnvIssue {
17    async fn title(&self) -> anyhow::Result<StyledString> {
18        Ok(StyledString::Text(rcstr!("Error loading dotenv file")))
19    }
20
21    fn stage(&self) -> IssueStage {
22        IssueStage::Load
23    }
24
25    async fn file_path(&self) -> anyhow::Result<FileSystemPath> {
26        Ok(self.path.clone())
27    }
28
29    async fn description(&self) -> anyhow::Result<Option<StyledString>> {
30        Ok(Some((*self.description.await?).clone()))
31    }
32}