Skip to content

refactor(ESModules): replace requires by imports in source files #2627

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JohnBerd
Copy link

@JohnBerd JohnBerd commented Mar 27, 2025

This package is incompatible with storybook 8+ with vite because require is not allowed in ES modules.

Fixes #2396

Comment on lines +1 to +4
declare module '*.png' {
const value: import('react-native').ImageSourcePropType;
export default value;
}
Copy link
Author

Choose a reason for hiding this comment

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

Without this file, typescript does not allow to import png

Comment on lines +1 to +4
import XDateClass from 'xdate';
import {toMarkingFormat} from './interface';

const XDate = XDateClass as any;
Copy link
Author

Choose a reason for hiding this comment

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

require types modules as any, since this change is leading to a lot of typing problems, I prefered to keep the same behavior as before

@JohnBerd
Copy link
Author

JohnBerd commented Apr 4, 2025

I need to know if it is worth resolving conflicts or this should be closed

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.

Mixing require and import
2 participants