medusajs / medusa

Building blocks for digital commerce
https://medusajs.com
MIT License
24.85k stars 2.48k forks source link

[BUG] clean command failing when packages are freezed #9295

Open SalahAdDin opened 1 week ago

SalahAdDin commented 1 week ago

Bug report

Describe the bug

A clear and concise description of what the bug is.

System information

Medusa version (including plugins):

"@medusajs/admin": "^7.1.16",
    "@medusajs/cache-inmemory": "1.8.11",
    "@medusajs/cache-redis": "^1.9.2",
    "@medusajs/event-bus-local": "1.9.9",
    "@medusajs/event-bus-redis": "^1.8.14",
    "@medusajs/file-local": "1.0.4",
    "@medusajs/medusa": "^1.20.10",
    "@rsc-labs/medusa-documents": "^0.8.4",
    "@tanstack/react-query": "4.22.0",
    "body-parser": "^1.19.0",
    "cors": "^2.8.5",
    "dotenv": "16.3.1",
    "express": "^4.17.2",
    "medusa-fulfillment-manual": "1.1.41",
    "medusa-interfaces": "1.3.10",
    "medusa-payment-manual": "1.0.25",
    "medusa-payment-stripe": "6.0.11",
    "medusa-plugin-typesense": "^0.0.1",
    "prism-react-renderer": "^2.0.4",
    "typeorm": "0.3.16"

Node.js version: v20.15.1 Database: Postgre SQL 13 Operating system: Manjaro Linux Browser (if relevant): Firefox

Steps to reproduce the behavior

  1. Setup the project with create-medusa-app: pnpm dlx create-medusa-app@latest
  2. Remove the packages and lock file: rm -rf node_modules yarn.lock
  3. Freeze the packages by removing ^ in package.json.
  4. Install packages again: yarn
  5. Run the developer mode: yarn dev.
  6. See the error.

Expected behavior

It should not give any error.

Screenshots

 yarn dev                                                        ✔  1m 4s  
yarn run v1.22.22
$ cross-env yarn run build:server && medusa develop
$ cross-env yarn run clean && tsc -p tsconfig.server.json
$ cross-env ./node_modules/.bin/rimraf dist
node_modules/@types/lodash/common/object.d.ts:1026:46 - error TS1005: '?' expected.

1026         : K extends `${infer N extends number}` ? T[N]
                                                  ~

node_modules/@types/lodash/common/object.d.ts:1031:46 - error TS1005: '?' expected.

1031         : K extends `${infer N extends number}` ? T[N]
                                                  ~

node_modules/@types/lodash/common/object.d.ts:1041:46 - error TS1005: '?' expected.

1041         : K extends `${infer N extends number}`
                                                  ~

node_modules/type-fest/source/camel-case.d.ts:25:32 - error TS1005: '?' expected.

25  infer FirstWord extends string,
                                  ~

node_modules/type-fest/source/camel-case.d.ts:26:42 - error TS1005: '?' expected.

26  ...infer RemainingWords extends string[],
                                            ~

node_modules/type-fest/source/join.d.ts:59:36 - error TS1005: '?' expected.

59    infer First extends JoinableItem,
                                      ~

node_modules/type-fest/source/join.d.ts:60:49 - error TS1005: '?' expected.

60    ...infer Tail extends readonly JoinableItem[],
                                                   ~

node_modules/type-fest/source/join.d.ts:64:50 - error TS1005: '?' expected.

64     ...infer Head extends readonly JoinableItem[],
                                                    ~

node_modules/type-fest/source/join.d.ts:65:36 - error TS1005: '?' expected.

65     infer Last extends JoinableItem,
                                      ~

Found 9 errors.

error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Code snippets

If applicable, add code samples to help explain your problem

Additional context

When putting the ^ back and removing the lock file, it works properly.

SalahAdDin commented 1 week ago

Packages affecting at the moment:

 yarn why @types/lodash               INT ✘ 
yarn why v1.22.22
[1/4] Why do we have the module "@types/lodash"...?
[2/4] Initialising dependency graph...
warning Resolution field "glob@7.1.6" is incompatible with requested version "glob@^8.0.3"
warning Resolution field "glob@7.1.6" is incompatible with requested version "glob@^10.3.10"
warning Resolution field "glob@7.1.6" is incompatible with requested version "glob@^8.0.3"
warning Resolution field "glob@7.1.6" is incompatible with requested version "glob@^8.1.0"
warning Resolution field "glob@7.1.6" is incompatible with requested version "glob@^7.2.0"
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "@types/lodash@4.17.9"
info Reasons this module exists
   - "@medusajs#admin#@medusajs#admin-ui#react-json-tree" depends on it
   - Hoisted from "@medusajs#admin#@medusajs#admin-ui#react-json-tree#@types#lodash"
   - Hoisted from "@medusajs#admin#@medusajs#admin-ui#react-json-tree#react-base16-styling#@types#lodash"
info Disk size without dependencies: "3.59MB"
info Disk size with unique dependencies: "3.59MB"
info Disk size with transitive dependencies: "3.59MB"
info Number of shared dependencies: 0
Done in 0.33s.

And

 yarn why type-fest                       ✔ 
yarn why v1.22.22
[1/4] Why do we have the module "type-fest"...?
[2/4] Initialising dependency graph...
warning Resolution field "glob@7.1.6" is incompatible with requested version "glob@^8.0.3"
warning Resolution field "glob@7.1.6" is incompatible with requested version "glob@^10.3.10"
warning Resolution field "glob@7.1.6" is incompatible with requested version "glob@^8.0.3"
warning Resolution field "glob@7.1.6" is incompatible with requested version "glob@^8.1.0"
warning Resolution field "glob@7.1.6" is incompatible with requested version "glob@^7.2.0"
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "type-fest@3.13.1"
info Has been hoisted to "type-fest"
info Reasons this module exists
   - Hoisted from "@medusajs#admin#@medusajs#admin-ui#type-fest"
   - Hoisted from "@medusajs#event-bus-local#@medusajs#utils#@mikro-orm#migrations#umzug#type-fest"
info Disk size without dependencies: "568KB"
info Disk size with unique dependencies: "568KB"
info Disk size with transitive dependencies: "568KB"
info Number of shared dependencies: 0
=> Found "boxen#type-fest@0.20.2"
info This module exists because "@medusajs#medusa#boxen" depends on it.
info Disk size without dependencies: "232KB"
info Disk size with unique dependencies: "232KB"
info Disk size with transitive dependencies: "232KB"
info Number of shared dependencies: 0
=> Found "eslint#type-fest@0.8.1"
info Reasons this module exists
   - "eslint#globals" depends on it
   - Hoisted from "eslint#globals#type-fest"
info Disk size without dependencies: "112KB"
info Disk size with unique dependencies: "112KB"
info Disk size with transitive dependencies: "112KB"
info Number of shared dependencies: 0
=> Found "ansi-escapes#type-fest@0.21.3"
info This module exists because "jest#@jest#core#ansi-escapes" depends on it.
info Disk size without dependencies: "256KB"
info Disk size with unique dependencies: "256KB"
info Disk size with transitive dependencies: "256KB"
info Number of shared dependencies: 0
Done in 0.30s.