forked from oraoto/pib
-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
PhpNode and PhpCgiNode locateFile breaks dynamic imports #55
Comments
Possible workaround: import { PhpBase } from 'php-wasm/PhpBase.mjs';
import PhpBinary from 'php-wasm/php-node.mjs';
const php = new PhpBase(PhpBinary, {
persist: {
mountPath: '/persist',
localPath: process.cwd() + '/tests/fixtures/'
},
sharedLibs: [
await import('php-wasm-zlib'),
await import('php-wasm-libzip')
`` |
I don't think this is quite working either as when I debug I find it trying to load |
WIP branch where I'm trying this out: https://github.com/mglaman/wasm-drupal/blob/9768d93d0b4bca056a87d40dfc5a06264b2c5190/tests/init-phpcode.test.js
|
Okay, I got it working this way: using PhpBase and not PhpNode import { PhpBase } from 'php-wasm/PhpBase.mjs';
import PhpBinary from 'php-wasm/php-node.mjs';
const php = new PhpBase(PhpBinary, {
persist: {
mountPath: '/persist',
localPath: process.cwd() + '/tests/fixtures/'
},
sharedLibs: [
{
name: `php${PhpNode.phpVersion}-zip.so`,
url: `${process.cwd()}/node_modules/php-wasm-libzip/php${PhpNode.phpVersion}-zip.so`,
ini: true
},
{
name: `libzip.so`,
url: `${process.cwd()}/node_modules/php-wasm-libzip/libzip.so`,
ini: false
},
{
name: `php${PhpNode.phpVersion}-zlib.so`,
url: `${process.cwd()}/node_modules/php-wasm-zlib/php${PhpNode.phpVersion}-zlib.so`,
ini: true
},
{
name: `libz.so`,
url: `${process.cwd()}/node_modules/php-wasm-zlib/libz.so`,
ini: false
},
]
}); |
mglaman
changed the title
PhpNode.locateFile breaks dynamic imports
PhpNode and PhpCgiNode locateFile breaks dynamic imports
Aug 22, 2024
ah, this is my fault for getting "creative." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying out PhpNode and the following:
All is good until the following: See following screenshot
The
path
isphp8.3-zlib.so
, buturlLibs[path]
has the proper URL. Butlocated
returns a value even though it is wrong.locateFile
never returns undefined when using PhpNode and returns files which do not exist. See result in the next screenshot.The text was updated successfully, but these errors were encountered: