medusajs / medusa

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

Yarn build fails on @medusajs/client-types when setting up local development #5308

Open springstan opened 10 months ago

springstan commented 10 months ago

Bug report

Describe the bug

Tried setting up medusa for local development on a new machine following this guide: https://docs.medusajs.com/development/fundamentals/local-development

Yarn install works after using the option nmMode: hardlinks-local in .yarnrc.yaml (link to relevant issue: https://github.com/medusajs/medusa/issues/2181) Yarn build does not work and fails on @medusajs/client-types.

System information

Medusa version (including plugins): v1.17.1 (no plugins) Node.js version: v18.17.1 Yarn version: 3.2.1 Database: PostgreSQL Operating system: Windows 11 Browser (if relevant): not relevant

Steps to reproduce the behavior

  1. Run Yarn install
  2. Run Yarn build
  3. Receive the following error

Expected behavior

Yarn build goes through successfully.

Screenshots

If applicable, add screenshots to help explain your problem

Error snippets

@medusajs/client-types:build: C:\Users\UserName\Programming\medusa\node_modules\execa\lib\error.js:60
@medusajs/client-types:build:           error = new Error(message);
@medusajs/client-types:build:           ^
@medusajs/client-types:build: Error: Command failed with exit code 1: medusa-oas oas --out-dir=C:\Users\UserName\AppData\Local\Temp\a55Pwk --type=combined
@medusajs/client-types:build: 🔴 Invalid OAS - combined {
@medusajs/client-types:build:   stack: 'MissingPointerError: Token "Error" does not exist.\n' +
@medusajs/client-types:build:     '    at Pointer.resolve (C:\\Users\\UserName\\Programming\\medusa\\node_modules\\@readme\\json-schema-ref-parser\\lib\\pointer.js:94:13)\n' +
@medusajs/client-types:build:     '    at $Ref.resolve (C:\\Users\\UserName\\Programming\\medusa\\node_modules\\@readme\\json-schema-ref-parser\\lib\\ref.js:118:20)\n' +
@medusajs/client-types:build:     '    at $Refs._resolve (C:\\Users\\UserName\\Programming\\medusa\\node_modules\\@readme\\json-schema-ref-parser\\lib\\refs.js:162:15)\n' +
@medusajs/client-types:build:     '    at dereference$Ref (C:\\Users\\UserName\\Programming\\medusa\\node_modules\\@readme\\json-schema-ref-parser\\lib\\dereference.js:186:25)\n' +
@medusajs/client-types:build:     '    at crawl (C:\\Users\\UserName\\Programming\\medusa\\node_modules\\@readme\\json-schema-ref-parser\\lib\\dereference.js:88:28)\n' +
@medusajs/client-types:build:     '    at crawl (C:\\Users\\UserName\\Programming\\medusa\\node_modules\\@readme\\json-schema-ref-parser\\lib\\dereference.js:115:28)\n' +
@medusajs/client-types:build:     '    at crawl (C:\\Users\\UserName\\Programming\\medusa\\node_modules\\@readme\\json-schema-ref-parser\\lib\\dereference.js:115:28)\n' +
@medusajs/client-types:build:     '    at crawl (C:\\Users\\UserName\\Programming\\medusa\\node_modules\\@readme\\json-schema-ref-parser\\lib\\dereference.js:115:28)\n' +
@medusajs/client-types:build:     '    at crawl (C:\\Users\\UserName\\Programming\\medusa\\node_modules\\@readme\\json-schema-ref-parser\\lib\\dereference.js:115:28)\n' +
@medusajs/client-types:build:     '    at crawl (C:\\Users\\UserName\\Programming\\medusa\\node_modules\\@readme\\json-schema-ref-parser\\lib\\dereference.js:115:28)',
@medusajs/client-types:build:   code: 'EMISSINGPOINTER',
@medusajs/client-types:build:   message: 'Token "Error" does not exist.',
@medusajs/client-types:build:   source: 'c:/Users/UserName/Programming/medusa/packages/generated/client-types/',
@medusajs/client-types:build:   path: null,
@medusajs/client-types:build:   toJSON: [Function: toJSON],
@medusajs/client-types:build:   name: 'MissingPointerError',
@medusajs/client-types:build:   footprint: 'null+c:/Users/UserName/Programming/medusa/packages/generated/client-types/+EMISSINGPOINTER+Token "Error" does not exist.',
@medusajs/client-types:build:   toString: [Function: toString]
@medusajs/client-types:build: }

Additional context

No changes have yet been made so it should work out of the box.

olivermrbl commented 10 months ago

What version of yarn are you using?

YCanvas commented 10 months ago

Any solution for this, facing exact same problem on Windows 10. node version > v18.16.0 Yarn version > 3.6.4

springstan commented 10 months ago

What version of yarn are you using?

I am using yarn version 3.2.1. Installed via npm install --global yarn

ilshm commented 9 months ago

Has anybody fixed this?

MicahBCode commented 7 months ago

Still reproducable using node version 16.20.2 and yarn version 3.2.1.

Any news about this?

ilshm commented 7 months ago

Still reproducable using node version 16.20.2 and yarn version 3.2.1.

Any news about this?

Build on linux or Ubuntu WSL, Windows doesn't work.

MicahBCode commented 7 months ago

Isn't there any solution to this in order to develop on windows. Seems quite uncomfortably this way.

czw333221 commented 7 months ago

我也出现这样的错误

ivanushkaPr commented 7 months ago

Same bug here. Yarn - 4.0.2 npm - v18.17.1 OS - windows 11.

MicahBCode commented 7 months ago

The PR to fix this issue was opened (#6044) but not yet approved / merged. Waiting for any response of the core team.