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

fix/optipng module issue on armx64 #198

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

anasnadeemws
Copy link
Collaborator

@anasnadeemws anasnadeemws commented Mar 6, 2024

Ticket Link


Related Links


Description

optipng-bin module not found error on M1 & M2 armx64

Steps to Reproduce / Test

  1. Clone the repo in M1 armx64 (Check if you've armx64 by node -p "process.arch")
  2. yarn install (Even tho everything will get successful you'll see some warning error from optipng )
  3. yarn start (Error from optipng-bin or pngbinquant will occur. Refer to ss below)
  4. Try fixing the error by adding that module
  5. You'll still get the error from import of png file logo in Header component (Refer ss below. Also try commenting it out to verify this)
Screenshot 2024-03-06 at 11 20 12 AM Screenshot 2024-03-06 at 11 21 29 AM

Checklist

  • PR description included
  • yarn test passes
  • Tests are [changed or added]
  • Relevant documentation is changed or added (and PR referenced)

GIF's


Live Link


Summary by CodeRabbit

  • Chores
    • Disabled optipng optimization to prevent errors on Mac M1 & M2 environments. Instructions provided for re-enabling if desired.

Copy link

coderabbitai bot commented Mar 6, 2024

Walkthrough

This update primarily focuses on adjusting the webpack configuration to disable optipng optimization. This decision was made to prevent potential errors that could arise in environments running on Mac M1 and M2 chips. Users who might require this feature and are confident in their setup have been provided with guidance on how to manually re-enable the optimization.

Changes

File Path Change Summary
internals/webpack/.../webpack.config.base.js Disabled optipng optimization due to potential errors on Mac M1 & M2. Instructions provided for re-enabling.

🐰✨
In the code, we hop and tweak,
Disabling optipng, so unique.
For M1 and M2, we take a peek,
Ensuring no error makes it bleak.
If you wish it back, just seek!
🌟🐇

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 3bb5362 and caa8b4f.
Files selected for processing (1)
  • internals/webpack/webpack.config.base.js (1 hunks)

Comment on lines +138 to +142
enabled: false
// NOTE: optipng is disabled as it causes errors in some Mac M1 & M2 environments
// Try enabling it in your environment by switching the config to:
// enabled: true,
// optimizationLevel: 7
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disabling optipng optimization for Mac M1 & M2 environments is a pragmatic solution to ensure compatibility across different hardware architectures. However, it's important to document this change prominently in the project's README or developer documentation, not just within the code comments. This ensures that all developers are aware of the optimization features that are disabled by default and how they can re-enable them if their environment supports it.

Consider adding a section in the project's README or developer documentation that outlines known compatibility issues and their workarounds, including this specific change regarding optipng.

Copy link

github-actions bot commented Mar 6, 2024

Jest Coverage Report

Total coverage

Status Category Percentage Covered / Total
🟢 Statements 98.62% 357/362
🟢 Branches 95.76% 113/118
🟢 Functions 98.31% 116/118
🟢 Lines 98.73% 310/314

Status of coverage: 🟢 - ok, 🟡 - slightly more than threshold, 🔴 - under the threshold

Report generated by 🧪jest coverage report action from caa8b4f

Copy link

sonarqube-ws bot commented Mar 6, 2024

Passed

Analysis Details

0 Issues

  • Bug 0 Bugs
  • Vulnerability 0 Vulnerabilities
  • Code Smell 0 Code Smells

Coverage and Duplications

  • Coverage No coverage information (98.20% Estimated after merge)
  • Duplications No duplication information (0.00% Estimated after merge)

Project ID: wednesday-solutions_react-template_AY4NDr6dB2n8RRmGoUim

View in SonarQube

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants