Skip to content
This repository has been archived by the owner on May 10, 2023. It is now read-only.

Doesn't work on everyone but Daniel's computer #3

Open
danielbachhuber opened this issue Mar 22, 2023 · 5 comments
Open

Doesn't work on everyone but Daniel's computer #3

danielbachhuber opened this issue Mar 22, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@danielbachhuber
Copy link
Owner

Props to @dmsnell for finding the cause:

image

@danielbachhuber danielbachhuber added the bug Something isn't working label Mar 22, 2023
@danielbachhuber
Copy link
Owner Author

@adamziel @dmsnell I'm not sure why it's getting packed up like this 🙃

Here's where I'm pulling in getPHPLoaderModule:

import { PHP, PHPServer, loadPHPRuntime, getPHPLoaderModule, PHPBrowser } from './built-php-wasm-node';

There aren't any symlinks that I'm aware of in the project. All I did was run vsce package.

Any ideas?

@dmsnell
Copy link

dmsnell commented Mar 22, 2023

@adamziel suggested this fix to the webpack config, presuming that it was realizing the full filepaths at compile time when it should have left them hanging.

Copy the contents and run pbpaste | patch -p1

diff --git a/webpack.config.js b/webpack.config.js
index 7febf52..1228ffc 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -30,6 +30,9 @@ const extensionConfig = {
     extensions: ['.tsx', '.ts', '.js']
   },
   module: {
+    parser: {
+      javascript: { importMeta: false }
+    },
     rules: [
       {
         test: /\.ts$/,

@adamziel
Copy link
Collaborator

Webpack replacing import.meta.url in built-php-node-wasm with a literal path. If the config @dmsnell posted works, great. If not, I've been using (import.meta || {}).url as a workaround.

danielbachhuber added a commit that referenced this issue Mar 22, 2023
@danielbachhuber
Copy link
Owner Author

Just pushed a 0.0.2 with that change applied. Can someone test to see if it works now? 65726e2

@adamziel Can you create an Azure DevOps account so I can grant you publishing rights to the extension? I'm traveling tomorrow, then AFK Friday and next week, so it'd probably be good to remove my bus factor.

@dmsnell
Copy link

dmsnell commented Mar 22, 2023

strangely, after updating to this new version, I get the following error when I attempt to launch the playground

Screenshot 2023-03-22 at 4 07 59 PM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants