extension-js / extension.js

🧩 Plug-and-play, zero-config, cross-browser extension development tool.
https://extension.js.org
MIT License
3.61k stars 89 forks source link

Development on WSL2 or Linux command based environments #141

Open patrickgdl opened 1 month ago

patrickgdl commented 1 month ago

Issue with Running in WSL2 - Stuck on "compiled successfully"

Description: I'm encountering issues when running within a WSL2 instance. I'm seeking best practices, suggestions, or examples for handling such setups on command-line-based Linux environments.

Steps to Reproduce:

  1. Set up an alias to the Windows Chrome version using google-chrome.
  2. Attempt to run the development server.

Observed Behavior: Upon executing the command, I receive the following error:

TypeError [ERR_INVALID_ARG_TYPE]: The "paths[0]" argument must be of type string. Received null
at Object.resolve (node:path:1101:7)
at y.launchChrome (/home/patrick/development/my-project/node_modules/webpack-run-chrome-extension/dist/module.js:14:10581)

This seems related to Chrome not being installed within WSL2.

Troubleshooting Steps Taken:

  1. Installed Chrome in WSL2 following these steps.
  2. Verified that Chrome works by calling it via google-chrome, which creates a separate instance of Chrome from Windows but functions correctly.

Current Behavior: When running extension dev, the process gets stuck on compiled successfully without progressing further:

🧩 Extension.js ►►► my-project (v2.63) is using TypeScript config file.
🧩 Extension.js ►►► my-project (v2.63) extension-env.d.ts already exists.
🧩 Extension.js ►►► my-project (v2.63) is using Tailwind config file.
🧩 Extension.js ►►► my-project (v2.63) is using React.  
🧩 Extension.js ►►► my-project (v2.63) (webpack 5.92.1) compiled successfully in 2034 ms

Versions Tested:

Additional Information:

Any help or guidance on resolving this issue would be greatly appreciated!

patrickgdl commented 1 month ago

Got it working with the installed Chrome in WSL2.

But it is a Turborepo and it only works when I am inside the extension folder and running npm run dev, it doesn't work when I run turbo run dev --filter=@my-project/extension. Throws the same TypeError [ERR_INVALID_ARG_TYPE]: The "paths[0]" argument must be of type string. Received null.

Maybe is something related to Turborepo?

cezaraugusto commented 1 month ago

hi @patrickgdl thanks for reporting! the error you found is a regression also reported in https://github.com/extension-js/extension.js/issues/138. This will be patched in the next release which should happen in the next few days. I'll keep this ticket open for tracking and will let you know when fixed.