Skip to content

Conversation

@crysadrak
Copy link
Collaborator

No description provided.

@crysadrak crysadrak requested review from Copilot and jsimck January 15, 2026 08:18
@changeset-bot
Copy link

changeset-bot bot commented Jan 15, 2026

⚠️ No Changeset found

Latest commit: 2d6c240

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR attempts to fix a migration require path in the 20.0.0 migration documentation by adding /dist/ to the degradation module import path. However, the change appears to introduce an error rather than fix one, as the @ima/server package does not have a dist folder and the correct path should not include /dist/.

Changes:

  • Modified require path from @ima/server/degradation to @ima/server/dist/degradation in one location

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

#### New configuration:
```javascript
const { createUserAgentDegradation, invert } = require('@ima/server/degradation');
const { createUserAgentDegradation, invert } = require('@ima/server/dist/degradation');
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The require path @ima/server/dist/degradation is incorrect. The @ima/server package does not have a dist folder (confirmed by checking .npmignore which publishes lib/**/* instead). The correct path should be require('@ima/server/degradation') which works because the degradation functions are re-exported from the main index.js file. Additionally, line 636 in this same file still uses @ima/server/degradation without /dist/, creating an inconsistency.

Suggested change
const { createUserAgentDegradation, invert } = require('@ima/server/dist/degradation');
const { createUserAgentDegradation, invert } = require('@ima/server/degradation');

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You are not right - the code is compiled under dist folder and direct require from @ima/server/degradation fails on not existing resource. There is no exports in main/index/package of this file and since it is required directly the full path is necesary

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.

2 participants