Skip to content

Instantly share code, notes, and snippets.

@sirreal
Last active April 30, 2026 11:01
Show Gist options
  • Select an option

  • Save sirreal/55b58d6a4305455c69f1283602134fd8 to your computer and use it in GitHub Desktop.

Select an option

Save sirreal/55b58d6a4305455c69f1283602134fd8 to your computer and use it in GitHub Desktop.

Demo of type issues using only @wp-playground/client as a dependency.

Requires skipLibCheck: false. However, this impacts type information in the application.

tsc --build
node_modules/@wp-playground/client/index.d.ts(1,15): error TS2307: Cannot find module '@wp-playground/blueprints' or its corresponding type declarations.
node_modules/@wp-playground/client/index.d.ts(2,257): error TS2307: Cannot find module '@php-wasm/universal' or its corresponding type declarations.
node_modules/@wp-playground/client/index.d.ts(3,43): error TS2307: Cannot find module '@wp-playground/wordpress' or its corresponding type declarations.
node_modules/@wp-playground/client/index.d.ts(4,110): error TS2307: Cannot find module '@php-wasm/universal' or its corresponding type declarations.
node_modules/@wp-playground/client/index.d.ts(5,33): error TS2307: Cannot find module '@php-wasm/util' or its corresponding type declarations.
node_modules/@wp-playground/client/index.d.ts(7,75): error TS2307: Cannot find module '@wp-playground/blueprints' or its corresponding type declarations.
node_modules/@wp-playground/client/index.d.ts(8,43): error TS2307: Cannot find module '@wp-playground/wordpress' or its corresponding type declarations.
node_modules/@wp-playground/client/index.d.ts(9,33): error TS2307: Cannot find module '@php-wasm/progress' or its corresponding type declarations.
node_modules/@wp-playground/client/index.d.ts(10,56): error TS2307: Cannot find module '@wp-playground/remote' or its corresponding type declarations.
node_modules/@wp-playground/client/index.d.ts(11,32): error TS2307: Cannot find module '@php-wasm/universal' or its corresponding type declarations.
import * as Client from '@wp-playground/client';
// This has type information, the type would be correctly inferred:
const c: Client.PlaygroundClient = await Client.startPlaygroundWeb({
iframe: document.querySelector('#frame')!,
remoteUrl: 'remote.html',
});
// `c` has no type information becuase `PlaygroundClient` requires missing types.
c
// At least these seem to be missing to get the correct types:
// - '@php-wasm/progress';
// - '@php-wasm/universal';
// - '@php-wasm/util';
// - '@wp-playground/blueprints';
// - '@wp-playground/remote';
// - '@wp-playground/wordpress';
{
"name": "test-playground-types",
"version": "1.0.0",
"description": "",
"license": "ISC",
"author": "",
"type": "commonjs",
"main": "index.js",
"scripts": {
"start": "tsc --build",
"test": "tsc --build"
},
"devDependencies": {
"typescript": "6.0.3"
},
"dependencies": {
"@wp-playground/client": "3.1.21"
}
}
{
"$schema": "https://www.schemastore.org/tsconfig.json",
"compilerOptions": {
"rootDir": ".",
"target": "esnext",
"moduleResolution": "bundler",
"types": [],
"noEmit": true,
"strict": true,
"verbatimModuleSyntax": true,
"isolatedModules": true,
"noUncheckedSideEffectImports": true,
"moduleDetection": "force",
"skipLibCheck": false,
"skipDefaultLibCheck": true
},
"files": ["./index.mts"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment