Skip to content
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

Add package.json to exports #3601

Merged
merged 1 commit into from
Dec 20, 2023
Merged

Add package.json to exports #3601

merged 1 commit into from
Dec 20, 2023

Conversation

ambar
Copy link
Contributor

@ambar ambar commented Dec 16, 2023

webpack:

warn Package date-fns has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in ./node_modules/date-fns/package.json

node:

node -e "require('date-fns/package.json')"

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './package.json' is not defined by "exports" in ./node_modules/date-fns/package.json

@kossnocorp
Copy link
Member

Can you please explain why

@ambar
Copy link
Contributor Author

ambar commented Dec 20, 2023

My assumption is some tools need to read package.json to get meta information about the project, most importantly the exports/dependencies field.
If you don't declare it, these tools can't read it.

My warning come from https://github.com/react-native-community/cli, you can close this issue because it seems unnecessary.

@kossnocorp kossnocorp merged commit 25c8237 into date-fns:main Dec 20, 2023
@kossnocorp
Copy link
Member

Appreciate it; it will go live with 3.0.2

@kossnocorp
Copy link
Member

Shipped with date-fns@3.0.2

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.

None yet

2 participants