Skip to content
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

[BUG] TailwindCSS example does not build #1156

Open
2 of 3 tasks
DenizUgur opened this issue Jan 13, 2025 · 24 comments
Open
2 of 3 tasks

[BUG] TailwindCSS example does not build #1156

DenizUgur opened this issue Jan 13, 2025 · 24 comments
Labels
bug Something isn't working

Comments

@DenizUgur
Copy link

DenizUgur commented Jan 13, 2025

What happened?

I'm getting segmentation fault for building the TailwindCSS example. I haven't changed anything inside the example and just built the example as-is.

pnpm create plasmo --with-tailwindcss
pnpm build

Removing references to the stylesheet with tailwind directives does not result in the segmentation fault but of course this is not a fix.

Related to #1089 I suppose.

Versions:
Node: v22.13.0
pnpm: 9.15.3
plasmo: v0.89.4

Version

Latest

What OS are you seeing the problem on?

Linux

What browsers are you seeing the problem on?

No response

Relevant log output

🟣 Plasmo v0.89.4
🔴 The Browser Extension Framework
🔵 INFO   | Prepare to bundle the extension...
🔵 INFO   | Building for target: chrome-mv3
🔵 INFO   | Loaded environment variables from: []
(node:88306) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Segmentation fault (core dumped)
 ELIFECYCLE  Command failed with exit code 139.

(OPTIONAL) Contribution

  • I would like to fix this BUG via a PR

Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I checked the current issues for duplicate problems.
@DenizUgur DenizUgur added the bug Something isn't working label Jan 13, 2025
@gregoryPacific
Copy link

I'm facing the same issue in a project.

It's important to note that the pnpm plasmo dev command works, but the pnpm plasmo build command does not.

Even though an error appears, it seems that Plasmo is still able to generate the build somehow, as the build files are being generated.

Versions:
Node: v18.18.0
pnpm: v9.15.4
plasmo: v0.89.4

Version

Latest

What OS are you seeing the problem on?

Ubuntu 24.04.1 LTS running on WSL2

Relevant log output:

image

@spiceworm
Copy link

I am also experiencing this issue.

@detronetdip
Copy link

Any update on this? I'm also facing he same issue

@gregoryPacific
Copy link

I think there are conflicts between subdependencies and Plasmo after running the pnpm update on an older project. These conflicts caused problems on build and I had to roll back the changes on pnpm-lock.yaml to restore functionality.

I suspect that a sub-dependency in its newest version is causing this issue, but I haven't been able to pinpoint it.

@ahmedazizkhelifi
Copy link
Contributor

ahmedazizkhelifi commented Feb 3, 2025

I faced the same issue; pnpm run dev works, but the build script does not.

I resolved this by downgrading pnpm to version 7.33.7 btw, I’m using Plasmo 0.57.2

@osarhan
Copy link

osarhan commented Feb 3, 2025

@ahmedazizkhelifi I just did that, and it worked for me as well! Thanks for the tip. Now I am trying to figure out what im missing from plasmo between 0.57.2 to 0.89.4.

btw, I was able to still use the latest version of pnpm

Edit:
The latest version I can get mine to build with is plasmo version 0.78.0, but nothing later than that. One thing to note is that I use the sidepanel for my extension, and version 0.79.0 introduces that. so having the side panel api, and that version seems to break the build process.

@osarhan
Copy link

osarhan commented Feb 6, 2025

FYI - For what its worth, build works on my mac M2. However does not build in docker.

@pippinmole
Copy link
Collaborator

Getting this error when running plasmo build --target=chrome-mv3 in a GitHub CI.

Is this project still maintained? Last commit to main 3 months ago, and I'm not seeing many responses from maintainers.

@osarhan
Copy link

osarhan commented Feb 7, 2025

It's frustrating. However, this framework has been a godsend. So I'm thankful it exists. Has helped me develop my extension tremendously.

I have to deploy everything locally to avoid this build error. Im thinking this build error was an oversight due to it working locally, and not in a CI/CD environment.

Btw. Are you developing an extension with the side panel? I am, so I keep thinking that's the culprit.

@pippinmole
Copy link
Collaborator

However, this framework has been a godsend.

I agree. But dropping off the face of the earth for 3 months is a sign to steer clear. And I don't want to steer clear

Btw. Are you developing an extension with the side panel? I am, so I keep thinking that's the culprit.

I'm not using the feature, but the build cache does have a sidepanel.tsx with some code in it. I'm happy to provide more info if you ask specific questions - I don't fully understand how sidepanels work :)

@osarhan
Copy link

osarhan commented Feb 7, 2025

Hmm. Interesting.

If you're not using the sidepanel, I would downgrade your plasmo version to 0.78.0 and see if it builds in your ci/cd. 0.79.0 introduced the side panels api, and doesn't build for me.

For me I'm kind of screwed since I built my entire extension using side panel. 🫠

@ahmedazizkhelifi
Copy link
Contributor

If you're not using the sidepanel, I would downgrade your plasmo version to 0.78.0 and see if it builds in your ci/cd. 0.79.0 introduced the side panels api, and doesn't build for me.

I'm using GitHub CI/CD to build the extension, and it works without issues. If you don’t need the features introduced in ^0.79.0, downgrading to 0.78.0 should resolve the build problem.

@pippinmole
Copy link
Collaborator

@ahmedazizkhelifi

I'm using GitHub CI/CD to build the extension

Is this on version 0.78.0? Or latest?

@osarhan
Copy link

osarhan commented Feb 7, 2025

I have never contributed to this code base. But if I have time this weekend I may poke around to see if the side panel isn't being used, to not cache it to avoid the build failure...

@ahmedazizkhelifi
Copy link
Contributor

I faced the same issue; pnpm run dev works, but the build script does not.

I resolved this by downgrading pnpm to version 7.33.7 btw, I’m using Plasmo 0.57.2

@pippinmole Well, im using plasmo 0.57.2 and pnpm 7

    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Install Node.js
        uses: actions/setup-node@v3
        with:
          node-version: 16

      - uses: pnpm/[email protected]
        name: Install pnpm
        id: pnpm-install
        with:
          version: 7
          run_install: false

@osarhan Have you tried downgrading the pnpm version instead of Plasmo?

@osarhan
Copy link

osarhan commented Feb 7, 2025

Yeah downgrading on pnpm doesn't solve it for me. 😵‍💫 And I need the ^0.79.0 version since I'm dependent on side panel.

Latest version of pnpm and 0.78 version of plasmo builds fine.

@pippinmole
Copy link
Collaborator

Might not be the place to post, but downgrading to 0.78.0 gives me this error when trying to build.

Image

@pippinmole
Copy link
Collaborator

Short term fix for GitHub CI (Or I guess any CI) is to change your build OS to windows. I'm using windows-latestand it seems to build fine. Will update with any more info I get.

Image

@pippinmole
Copy link
Collaborator

So, I've done some further investigating...

What I did was work my way from a fresh install, slowly copying things over until something broke:

  1. Create a new testing branch
  2. Deleted my entire chrome extension
  3. Created an entirely new one with src directory
  4. At this point, it broke
  5. Delete styles.css and its import from newtab.tsx (line 3)
  6. This works

Not very helpful, since we all need stylesheets I assume. For now I'm just going to build on windows and hope that the devs pick this project back up

@osarhan
Copy link

osarhan commented Feb 7, 2025

@pippinmole lets go! This worked for me!

At this point, im not interested in investigating more, since I have a working pipeline now. I appreciate you digging into this! 💪

@lucasrui
Copy link

Short term fix for GitHub CI (Or I guess any CI) is to change your build OS to windows. I'm using windows-latestand it seems to build fine. Will update with any more info I get.

Image

this works for me too! can you share your yaml in GitHub CI?
here is my yaml,

name: "Submit to Web Store"
on:
  workflow_dispatch:

jobs:
  build:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v3
      - name: Cache pnpm modules
        uses: actions/cache@v3
        with:
          path: ~/.pnpm-store
          key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
          restore-keys: |
            ${{ runner.os }}-
      - uses: pnpm/action-setup@v4
        with:
          run_install: true
      - name: Use Node.js 22.x
        uses: actions/[email protected]
        with:
          node-version: 22.13.0
          cache: "pnpm"
      - name: Build the extension
        run: pnpm build
      - name: Package the extension into a zip artifact
        run: pnpm package
      - name: Browser Platform Publish
        uses: PlasmoHQ/bpp@v3
        with:
          keys: ${{ secrets.SUBMIT_KEYS }}
          artifact: build/chrome-mv3-prod.zip

node version:22.13.0
pnpm version:9.15.3
plasmo version:0.90.3

I face the same error as "Segmentation fault (core dumped)", when I runs-on ubuntu-latest

@pippinmole
Copy link
Collaborator

Hi everybody,

Unfortunately it looks like this is an upstream issue on the latest version of Parcel, which is a package we use. We may have to wait until parcel-bundler/parcel#10081 is noticed by the devs and fixed. Sorry for the inconvenience.

@osarhan
Copy link

osarhan commented Feb 19, 2025

@pippinmole Is there a parcel version we can pin in our plasmo projects to unbreak the build?

@jeffminim
Copy link

Hi everybody,

Unfortunately it looks like this is an upstream issue on the latest version of Parcel, which is a package we use. We may have to wait until parcel-bundler/parcel#10081 is noticed by the devs and fixed. Sorry for the inconvenience.

Encountering the same issue. Running directly under terminal without using Github CI will also report errors.
I've troubleshooted it and I feel that the problem occurs when compiling the css.

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

No branches or pull requests

9 participants