You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bring util;
bring cloud;
pub struct ViteProps {
root: str;
env: Map<str>?;
}
class ViteTfAws {
pub url: str;
new(props: ViteProps) {
// This command generates a `{props.root}/dist/` directory.
util.exec(
"pnpm",
["vite", "build"],
cwd: props.root,
inheritEnv: true,
env: props.env,
);
// Runs a `scandir` on `{props.root}/dist` (before it exists...).
let website = new cloud.Website(
path: "{props.root}/dist",
);
this.url = website.url;
}
}
new ViteTfAws(
root: "../website",
);
This happened:
runtime error: ENOENT: no such file or directory, scandir '/Users/cristian/Code/website/dist'
--> vite.w:88:19
| env: props.env,
| );
|
88 | let website = new cloud.Website(
I expected this:
The exec command creates the directory, but seems to be run after the Website resource is instantiated.
Both exec and shell utils return a promise, which isn't awaited by the resource preflight constructor.
I tried this:
Run
wing compile main.w -t tf-aws
on this file:This happened:
I expected this:
The exec command creates the directory, but seems to be run after the Website resource is instantiated.
Both exec and shell utils return a promise, which isn't awaited by the resource preflight constructor.
Is there a workaround?
You can create your own
spawnSync
-like extern:Anything else?
No response
Wing Version
No response
Node.js Version
No response
Platform(s)
No response
Community Notes
The text was updated successfully, but these errors were encountered: