-
Notifications
You must be signed in to change notification settings - Fork 14
doc: fix migration require path #659
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
base: master
Are you sure you want to change the base?
Conversation
|
There was a problem hiding this 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/degradationto@ima/server/dist/degradationin 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'); |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
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.
| const { createUserAgentDegradation, invert } = require('@ima/server/dist/degradation'); | |
| const { createUserAgentDegradation, invert } = require('@ima/server/degradation'); |
There was a problem hiding this comment.
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
No description provided.