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

generatePackageJson does not include date-fns if there are only slash imports #23163

Closed
1 of 4 tasks
leon opened this issue May 3, 2024 · 2 comments
Closed
1 of 4 tasks

Comments

@leon
Copy link
Contributor

leon commented May 3, 2024

Current Behavior

In a node app where i use date-fns I only import them using this type of imports.

import { addDays } from 'date-fns/addDays';
import { getWeek } from 'date-fns/getWeek';
import { isValid } from 'date-fns/isValid';

Expected Behavior

that package.json should contain date-fns as a dependency

GitHub Repo

https://github.com/leon/bug-nx-package-json-imports

Steps to Reproduce

  1. run build
  2. check dist/package.json

Nx Report

Node   : 20.11.1
OS     : darwin-arm64
pnpm   : 8.15.8

nx                 : 18.3.4
@nx/js             : 18.3.4
@nx/jest           : 18.3.4
@nx/linter         : 18.3.4
@nx/eslint         : 18.3.4
@nx/workspace      : 18.3.4
@nx/devkit         : 18.3.4
@nx/esbuild        : 18.3.4
@nx/eslint-plugin  : 18.3.4
@nx/node           : 18.3.4
@nrwl/tao          : 18.3.4
typescript         : 5.4.5
---------------------------------------
Registered Plugins:
@nx/eslint/plugin
@nx/jest/plugin

Failure Logs

No response

Package Manager Version

pnpm 8.15.8

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@leon leon added the type: bug label May 3, 2024
@leon
Copy link
Contributor Author

leon commented May 6, 2024

The same thing applies to firebase-admin, which I also only import using their new way of doing it.

firebase-admin/app
firebase-admin/storage
firebase-admin/auth
firebase-admin/firestore

@leon
Copy link
Contributor Author

leon commented May 6, 2024

Hmm
removed node_modules + pnpm-lock.yaml + nx reset
and now it works 🤷‍♂️

@leon leon closed this as completed May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant