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

EISDIR: illegal operation on a directory #8101

Closed
Petr-Hl opened this issue Jul 12, 2024 · 5 comments
Closed

EISDIR: illegal operation on a directory #8101

Petr-Hl opened this issue Jul 12, 2024 · 5 comments

Comments

@Petr-Hl
Copy link

Petr-Hl commented Jul 12, 2024

After "yarn build" command all js files appears in dist folder like folders not like files.

System information

Default configuration after fresh install by npx create-medusa-app@preview

Medusa CLI version: 1.3.22
Medusa version: 1.20.6-preview-20240712060553
Node.js version: v22.4.0
Database:
Operating system: Windows 11 23H2
Browser (if relevant):

Steps to reproduce the behavior

  1. yarn build
  2. See error:
yarn run v1.22.22
$ medusa build
Error: EISDIR: illegal operation on a directory, open 'H:\Medusa\dist\admin\widgets\product-widget.js'
    at async open (node:internal/fs/promises:639:25)
    at async writeFile (node:internal/fs/promises:1216:14)
    at async writeToOut (H:\Medusa\node_modules\@medusajs\medusa\src\commands\build.ts:70:3)        
    at async medusaTransform (H:\Medusa\node_modules\@medusajs\medusa\src\commands\build.ts:105:5)  
    at async Promise.all (index 3)
    at async default_1 (H:\Medusa\node_modules\@medusajs\medusa\src\commands\build.ts:137:3) {      
  errno: -4068,
  code: 'EISDIR',
  syscall: 'open',
  path: 'H:\\Medusa\\dist\\admin\\widgets\\product-widget.js'
}

Screenshots

image

@sradevski
Copy link
Member

sradevski commented Jul 12, 2024

Hey @Petr-Hl , can you please try again with the latest version? I believe #8023 should have fixed it.

@Petr-Hl
Copy link
Author

Petr-Hl commented Jul 13, 2024

Hey @sradevski , for sure I tried more times that. On the first one project - deleted node_modules, dist and yarn.lock. Now I tried create new one project bynpx create-medusa-app@previewcommand. All work good but the same issue.
medusa -v shows me this after the fresh install:
Medusa version: 1.20.6-preview-20240711150439

next after reinstall dependences I have this:
Medusa version: 1.20.6-preview-20240713030436

C:\Tmp\test-medusa2>yarn build
yarn run v1.22.22
$ medusa build
Error: EISDIR: illegal operation on a directory, open 'C:\Tmp\test-medusa2\dist\admin\routes\custom\page.js'
    at async open (node:internal/fs/promises:639:25)
    at async writeFile (node:internal/fs/promises:1216:14)
    at async writeToOut (C:\Tmp\test-medusa2\node_modules\@medusajs\medusa\src\commands\build.ts:70:3)
    at async medusaTransform (C:\Tmp\test-medusa2\node_modules\@medusajs\medusa\src\commands\build.ts:105:5)
    at async Promise.all (index 1)
    at async default_1 (C:\Tmp\test-medusa2\node_modules\@medusajs\medusa\src\commands\build.ts:137:3) {
  errno: -4068,
  code: 'EISDIR',
  syscall: 'open',
  path: 'C:\\Tmp\\test-medusa2\\dist\\admin\\routes\\custom\\page.js'
}
Done in 2.65s.

C:\Tmp\test-medusa2\src\admin\routes\custom\page.tsx -->

import { Container } from "@medusajs/ui";

const CustomPage = () => {
  return <Container>This is my custom route</Container>;
};

export default CustomPage;

but both has the same issue...
With Medusa v1.20 I had never problem.

@imash96
Copy link

imash96 commented Jul 13, 2024

Getting this below error

[Error: EISDIR: illegal operation on a directory, open 'F:\Projects\website\backend\dist\api\admin\custom\route.js'] {
errno: -4068,
code: 'EISDIR',
syscall: 'open',
path: 'F:\Projects\website\backend\dist\api\admin\custom\route.js'
}

@srindom srindom added the type: bug label Jul 17, 2024 — with Linear
@linear linear bot closed this as completed Jul 17, 2024
@carlos-r-l-rodrigues
Copy link
Contributor

@Petr-Hl @imash96 it should be fixed in the next preview release (in about 3 hours)
Please let me know if you have any issue.

Thanks

@Petr-Hl
Copy link
Author

Petr-Hl commented Jul 18, 2024

Hi @carlos-r-l-rodrigues , YES! Now it's OK,

thank you very much for close this issue!

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

5 participants