async function build() {
      const containerInstance = await makeWebcontainer();

      if (!containerInstance) {
        console.log('error due to failed instance');
        setError(
          'WebContainer failed to load. Please try reloading or use a different browser.',
        );
        return;
      }
      instance.current = containerInstance;

      // console.log('Trying to run `npm run dev`...');
      const process = await containerInstance.spawn('npm', ['run', 'dev']);
      // console.log('Spawned `npm run dev`...');
      process.output.pipeTo(
        new WritableStream({
          write(data) {
            console.log(data);
          },
        }),
      );
      // console.log('Waiting for server-ready event...');
      containerInstance.on('server-ready', (port, url) => {
        console.log('server-ready', port, url);
        setUrl(url);
        urlRef.current = url;
      });
    }
Function to build the WebContainer and start the development server.