Skip to content

Conversation

@AlexVarchuk
Copy link
Contributor

@AlexVarchuk AlexVarchuk commented Aug 14, 2025

What/Why/How?

When using loadConfig function to get the config for the browser environment, we get an error: "path.extname is not a function"

Reference

Testing

Screenshots (optional)

image (16) Screenshot 2025-08-14 at 14 53 34

Check yourself

  • Code changed? - Tested with Redoc/Realm/Reunite (internal)
  • All new/updated code is covered by tests
  • New package installed? - Tested in different environments (browser/node)

Security

  • The security impact of the change has been considered
  • Code follows company security practices and guidelines

@AlexVarchuk AlexVarchuk requested review from a team as code owners August 14, 2025 12:52
@changeset-bot
Copy link

changeset-bot bot commented Aug 14, 2025

🦋 Changeset detected

Latest commit: 545c06f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@redocly/openapi-core Patch
@redocly/cli Patch
@redocly/respect-core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

Command Mean [s] Min [s] Max [s] Relative
redocly lint packages/core/src/benchmark/benches/rebilly.yaml 1.424 ± 0.024 1.381 1.459 1.00
redocly-next lint packages/core/src/benchmark/benches/rebilly.yaml 1.436 ± 0.035 1.390 1.498 1.01 ± 0.03

(path.extname(filePath) === '.yaml' || path.extname(filePath) === '.yml') &&
!!fs?.existsSync?.(filePath)
);
const ext = filePath.substr(filePath.lastIndexOf('.'));
Copy link
Collaborator

Choose a reason for hiding this comment

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

The substr is deprecated already. Also, this doesn't handle the case when a file is named file or .env. It would be better to create a utility function and write a couple of tests for it.

@AlexVarchuk AlexVarchuk marked this pull request as draft October 23, 2025 12:15
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.

4 participants