I wanted to familiarize myself with the code base, but already struggle at the yarn run build step.
src/web/service-worker/index.ts, src/web.ts → build/web...
(!) Plugin typescript: @rollup/plugin-typescript TS2792: Cannot find module 'comlink'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?
src/php-library/comlink-utils.ts: (1:21)
1 import Comlink from 'comlink';
~~~~~~~~~
src/web/register-service-worker.ts: (1:29)
1 import type { Remote } from "comlink";
~~~~~~~~~
(!) Plugin typescript: @rollup/plugin-typescript TS5097: An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled.
src/web.ts: (1:15)
1 export * from './php-library/index.ts';
~~~~~~~~~~~~~~~~~~~~~~~~
src/web.ts: (2:15)
2 export * from './web/index.ts';
~~~~~~~~~~~~~~~~
(!) Unresolved dependencies
https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency
comlink (imported by "src/php-library/comlink-utils.ts")
created build/web in 1.5s
src/node.ts → build/node...
(!) Plugin typescript: @rollup/plugin-typescript TS2792: Cannot find module 'comlink'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?
src/php-library/comlink-utils.ts: (1:21)
1 import Comlink from 'comlink';
~~~~~~~~~
src/web/register-service-worker.ts: (1:29)
1 import type { Remote } from "comlink";
~~~~~~~~~
(!) Plugin typescript: @rollup/plugin-typescript TS5097: An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled.
src/web.ts: (1:15)
1 export * from './php-library/index.ts';
~~~~~~~~~~~~~~~~~~~~~~~~
src/web.ts: (2:15)
2 export * from './web/index.ts';
~~~~~~~~~~~~~~~~
created build/node in 1.3s
build/index.js 10.9kb
build/php-SQD4XQQA.ini 322b
⚡ Done in 10ms
src/index.ts → build/...
(node:76064) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(!) Unresolved dependencies
https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency
@wordpress/php-wasm (imported by "src/index.ts")
created build/ in 483ms
build/tsdoc-to-api-markdown.js 8.5mb ⚠️
⚡ Done in 261ms
vite v4.1.4 building for production...
transforming...
✓ 31 modules transformed.
rendering chunks...
computing gzip size...
build/index.js 58.83 kB │ gzip: 15.90 kB
[vite-plugin-static-copy] Copied 2 items.
vite v4.1.4 building for production...
transforming...
✓ 2 modules transformed.
rendering chunks...
computing gzip size...
build/setup-react-refresh-runtime.js 6.27 kB │ gzip: 2.53 kB
vite v4.1.4 building for production...
transforming...
new URL("/", import.meta.url) doesn't exist at build time, it will remain unchanged to be resolved at runtime
✓ 133 modules transformed.
[vite-plugin-static-copy] Copy count was not set.
[vite:worker] "default" is not exported by "../../node_modules/comlink/dist/esm/comlink.mjs", imported by "../php-wasm/src/php-library/comlink-utils.ts".
file: /path/to/wordpress-playground/packages/wordpress-playground/src/worker-thread.ts?worker&url:1:7
1: import Comlink from 'comlink';
^
2:
3: export function consumeAPI<APIType>(remote: Worker | Window) {
error during build:
RollupError: "default" is not exported by "../../node_modules/comlink/dist/esm/comlink.mjs", imported by "../php-wasm/src/php-library/comlink-utils.ts".
at error (file:///path/to/wordpress-playground/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:2105:30)
at Module.error (file:///path/to/wordpress-playground/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:13174:16)
at Module.traceVariable (file:///path/to/wordpress-playground/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:13559:29)
at ModuleScope.findVariable (file:///path/to/wordpress-playground/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:12061:39)
at FunctionScope.findVariable (file:///path/to/wordpress-playground/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:6836:38)
at ChildScope.findVariable (file:///path/to/wordpress-playground/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:6836:38)
at MemberExpression.bind (file:///path/to/wordpress-playground/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:9129:49)
at CallExpression.bind (file:///path/to/wordpress-playground/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:5726:23)
at CallExpression.bind (file:///path/to/wordpress-playground/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:9470:15)
at ConditionalExpression.bind (file:///path/to/wordpress-playground/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:5726:23)
ERROR: "build:js" exited with 1.
The command failed for workspaces that are depended upon by other workspaces; can't satisfy the dependency graph
Failed with errors in 10s 724ms
Using yarn 3.4.1 and Node 18.13.0
I wanted to familiarize myself with the code base, but already struggle at the
yarn run buildstep.Using yarn 3.4.1 and Node 18.13.0