-
Notifications
You must be signed in to change notification settings - Fork 6
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
photon compatibility #19
Comments
I patched it temporarily: diff --git a/dist/plugin.cjs b/dist/plugin.cjs
index a85e47a4ab4fefb6b25755a78c1dd631e764f040..a76f3b0716d89d2bde8c3d2a9f00064424281061 100644
--- a/dist/plugin.cjs
+++ b/dist/plugin.cjs
@@ -161,7 +161,7 @@ ${code}`;
resolved = false;
}
code += `
- ${moduleName}: {`;
+ ${JSON.stringify(moduleName)}: {`;
for (const name of importNames2) {
code += pkgImport ? `
${name}: _imports_${moduleName}.${name},
diff --git a/dist/plugin.mjs b/dist/plugin.mjs
index 6561b2e5906f7a676f68517ae2be6d7f79ecf88b..15226a90b79b1fcee97829b9ebe1051887d9dede 100644
--- a/dist/plugin.mjs
+++ b/dist/plugin.mjs
@@ -153,7 +153,7 @@ ${code}`;
resolved = false;
}
code += `
- ${moduleName}: {`;
+ ${JSON.stringify(moduleName)}: {`;
for (const name of importNames2) {
code += pkgImport ? `
${name}: _imports_${moduleName}.${name}, |
I would highly appreciate a runnable reproduction 🙏 |
There are probably easier ways to include a repro, but I ran in to the same problem with Prismas new database adapters. Here's a repro-link codesandbox.io. If you try yourself with prisma, it does require you to have generated the prisma client before building:
|
I'm not able to reproduce this at the moment; but @Zn4rK 's reproduction aligns with the issue I had |
Okay, i will try to assmble a reproduction for photon as well to track both separately 👍🏼 There might be same common issues but we always need reproduction to make sure all root causes are fixed. (prisma ~> #21) |
I will be able to provide a repro for photon by Sunday, as it happened on my work pc; And i couldn't make it happen again on my personal one. The issue so far is that key in imports object should have been enclosed by quotes. |
Repro: mukundshah/nitro-wasm#photon |
Thanks for nice reproduction @mukundshah. Added a fix via #24 keeping this issue open until make sure photon is fully compatible. |
Environment
Darwin
v21.6.2
2.9.1
[email protected]
Reproduction
N/A
Describe the bug
If a wasm contains imports from relative path, the module name will have foreign unintended characters.
For context,
photon-rs
has some imports from relative path, and using it causes the following error:This issue is resolved when moduleName is json-stringified at L180 in
unwasm/src/plugin/runtime.ts
Lines 180 to 186 in 67a94a9
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: