This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Description
Trying to use this package on NextJS Proj.
Having difficulties with the itegrations.
Steps to reproduce
npx create-next-app --typescript demo
cd demo
yarn add @vscode/webview-ui-toolkit
Usage with @vscode/webview-ui-toolkit/react
in index.tsx
import React from "react"
import { VSCodeButton } from "@vscode/webview-ui-toolkit/react";
export default function Page(){
return (<>
<VSCodeButton>click me</VSCodeButton>
</>);
}
will throw
Server Error
SyntaxError: Cannot use import statement outside a module
This error happened while generating the page. Any console logs will be displayed in the terminal window.

Nor the usage with @vscode/webview-ui-toolkit
import React from "react"
import "@vscode/webview-ui-toolkit";
declare global {
namespace JSX {
interface IntrinsicElements {
"vscode-progress-ring": any;
}
}
}
export default function Page(){
return (<>
<vscode-progress-ring></vscode-progress-ring>
</>);
}
This will throw SSR error - window is not defined
Will this package be ready to be used as plug-and-play in the near future ?
Ref