PlasmoHQ / plasmo

đŸ§© The Browser Extension Framework
https://www.plasmo.com
MIT License
10.25k stars 354 forks source link

[BUG] HMR not detecting changes in local workspace packages #1031

Open lucky-bai opened 2 months ago

lucky-bai commented 2 months ago

What happened?

Plasmo HMR does not work when changes are made in a local workspace package. Steps to reproduce:

  1. Set up a Plasmo project and add a local package dependency using pnpm workspaces. The package.json for the plasmo project contains the local foo dependency with the following configuration:
    {
    "dependencies": {
    "foo": "workspace:*"
    }
    }
  2. Run Plasmo in development mode. Then, make a change to the local foo package.
  3. Result: The changes are only picked up when they are made in the Plasmo project itself, but not when the changes are in the local foo package.

A similar setup in a Next.js project works correctly, with changes in local packages being picked up and reloaded as expected.

Plasmo version: 0.88.0.

Version

Latest

What OS are you seeing the problem on?

Linux

What browsers are you seeing the problem on?

Chrome

Relevant log output

No response

(OPTIONAL) Contribution

Code of Conduct

karthest commented 2 months ago

I assume that you have a plasmo project A first and then move it to /packages and try to use another package B located in /packages right ?

lucky-bai commented 2 months ago

My pnpm-workspace.yaml is as follows:

packages:
    - "common"
    - "nextjs"
    - "plasmo-extension"

In the root directory, plasmo-extension has a dependency on common. However, when I make a change in common, plasmo HMR does not trigger.

karthest commented 2 months ago

In my case it works as expected (plasmo versoin 0.88.0)