-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript : Property '#private' in type 'PHP' refers to a different member that cannot be accessed from within type 'PHP'. #1577
Labels
Comments
adamziel
added a commit
that referenced
this issue
Jul 8, 2024
The `@php-wasm/node` package used to be CommonJS only. This created tricky dependency identity problems in ESM applications, e.g. in #1577 the main script imports the ESM version of `@php-wasm/universal`, but `@php-wasm/node` imports the CJS version of it. This PR ensures `@php-wasm/node` has an ESM version available. This is first step towards solving #1583 Closes #1579 Closes #1577 ## Testing instructions Run `npm run build`, copy the built packages from `dist/packages/php-wasm` to node_modules in another directory, create a test.js script with the following contents: ``` import { PHP } from '@php-wasm/universal'; import { loadNodeRuntime, useHostFilesystem } from '@php-wasm/node'; const php = new PHP(await loadNodeRuntime('8.0')); console.log("Hey"); console.log(await php.run({ code: 'echo "Hello, World!";' })); ``` Then create a package.json file with `{"type":"module"}` and confirm that running test.js works. Then create test.cjs file as follows: ```js const { PHP } = require('@php-wasm/universal'); const { loadNodeRuntime } = require('@php-wasm/node'); async function main() { const runtimeId = await loadNodeRuntime('8.0'); console.log({runtimeId}) const php = new PHP(runtimeId); console.log(php); } main(); ``` And confirm this one works, too.
This works as expected now in version 0.9.18 |
@adamziel I am not sure if this is correct, but it seems this issue is still relevant. I can find in both files :
I still get the error :
Do you think this is related ? |
adamziel
added a commit
that referenced
this issue
Jul 16, 2024
…ps (#1593) pipeline. This caused the published packages to ship not just their own types but also all the types they import. This creates a lot of noise and also type identity conflicts between packages. This PR removes most of these rollup tasks, leaving only two: * In the `@wp-playground/blueprints` package for Types->JSON schema generation * In the `@wp-playground/client` package to make it self-contained and dependencyless. Related to #1577 ## Testing instructions Run `npm run build` and confirm the built packages only export their own types. --------- Co-authored-by: Brandon Payton <brandon@happycode.net>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With new behavior :
An error occurs with object
php
inuseHostFilesystem
:With new behavior :
An error occurs with method
createNodeFsMountHandler()
inphp.mount()
:The text was updated successfully, but these errors were encountered: