Skip to content

Add postinstall patch for postcss-safe-parser and harden FloorProfile variation handling#5

Open
tsarchghs wants to merge 1 commit into
mainfrom
codex/fix-err_package_path_not_exported-issue-rzszkz
Open

Add postinstall patch for postcss-safe-parser and harden FloorProfile variation handling#5
tsarchghs wants to merge 1 commit into
mainfrom
codex/fix-err_package_path_not_exported-issue-rzszkz

Conversation

@tsarchghs

Copy link
Copy Markdown
Member

Motivation

  • Fix build issues on newer Node/OpenSSL and address postcss-safe-parser requiring internal postcss modules that can be hoisted or renamed during install.
  • Prevent runtime crashes and incorrect pricing when floor data, variations, or selected wear-layer options are missing in the FloorProfile route.

Description

  • Update the build script in package.json to CI=false NODE_OPTIONS=--openssl-legacy-provider react-scripts build to avoid OpenSSL-related build failures.
  • Add a postinstall script in package.json to run node scripts/patch-postcss-safe-parser.js after install.
  • Add scripts/patch-postcss-safe-parser.js which patches node_modules/postcss-safe-parser/lib/safe-parser.js to resolve postcss internals via require.resolve('postcss') and path.join(...), with safety checks and logging.
  • Refactor src/routes/FloorProfile/index.js by adding helper methods getWearLayerOptions, getVariationMilType, and getMatchingVariation, guard against missing floor and variation, provide safe defaults for stock/price calculations, add a key prop to mapped elements, and ensure requestStockInfo handles absent variations gracefully.

Testing

  • Ran npm install to trigger the postinstall script and observed the patch script run or skip with a log message depending on postcss-safe-parser presence.
  • Ran npm run build to validate the updated build command and it completed successfully.
  • Ran npm test to execute the test suite and tests passed.

Codex Task

@vercel

vercel Bot commented Apr 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
solyd-floors Ready Ready Preview, Comment Apr 5, 2026 8:13pm

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cf39dcc6ba

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

let { loading, error, floor } = this.props;

if (loading) return <LoadingPage/>
if (!floor) return <LoadingPage/>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Handle error before floor-null loading fallback

When the floor fetch fails (for example a 404), Redux can provide error while floor remains undefined. With the new if (!floor) return <LoadingPage/> check placed before the error branch, the component now exits early and never renders E404 or ERROR, leaving users on a permanent loading state for failed requests.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant