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

Error: connect ECONNREFUSED 127.0.0.1:9315 #1085

Open
martinszeltins opened this issue Oct 11, 2022 · 4 comments
Open

Error: connect ECONNREFUSED 127.0.0.1:9315 #1085

martinszeltins opened this issue Oct 11, 2022 · 4 comments

Comments

@martinszeltins
Copy link

Describe the bug

I am seeing this error.

image

The contents of server.log:

Preview.js daemon server is now running on http://localhost:9315
   2   │ Creating Preview.js workspace (plugin: @previewjs/plugin-vue3) at /home/martins/Programming/tooltip.ai/app/client
   3   │ Preview.js Server running at http://localhost:3140.
   4   │ node:fs:1386
   5   │   handleErrorFromBinding(ctx);
   6   │   ^
   7   │ 
   8   │ Error: EACCES: permission denied, mkdir '/home/martins/Programming/tooltip.ai/app/client/node_modules/.previewjs/v8.0.1/vite/deps_temp'
   9   │     at Object.mkdirSync (node:fs:1386:3)
  10   │     at runOptimizeDeps (file:///home/martins/.vscode/extensions/zenclabs.previewjs-1.15.2/dist/node_modules/vite/dist/node/chunks/dep-db16f19c.js:42281:14)
  11   │     at Timeout._onTimeout (file:///home/martins/.vscode/extensions/zenclabs.previewjs-1.15.2/dist/node_modules/vite/dist/node/chunks/dep-db16f19c.js:41698:54)
  12   │     at runMicrotasks (<anonymous>)
  13   │     at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  14   │   errno: -13,
  15   │   syscall: 'mkdir',
  16   │   code: 'EACCES',
  17   │   path: '/home/martins/Programming/tooltip.ai/app/client/node_modules/.previewjs/v8.0.1/vite/deps_temp'
  18   │ }

Reproduction

Just openening any component with Preview.js

Preview.js version

v1.15.2

Framework

Vue 3.2.37

System Info

Ubuntu Linux 20.04.4 LTS
Visual Studio Code

Used Package Manager

yarn

Extension logs (useful for crashes)

No response

Preview logs (useful for rendering errors)

No response

Repo link (if available)

No response

Anything else?

No response

@fwouts
Copy link
Owner

fwouts commented Oct 11, 2022

Thanks for the report @martinszeltins!

The permission denied error seems to be the culprit.

Do you have particularly strict file access rules for node_modules? Or perhaps it's owned by another user on the system?

@martinszeltins
Copy link
Author

Thanks for the report @martinszeltins!

The permission denied error seems to be the culprit.

Do you have particularly strict file access rules for node_modules? Or perhaps it's owned by another user on the system?

@fwouts yes, that is true. Since I am using Docker for my project, the node_modules was created from inside the Docker container so I do not have access to it unless I change the permissions of node_modules manually. I will try to chnage permissions of node_modules to see if that helps. But this is not ideal.

@martinszeltins
Copy link
Author

@fwouts As it turned out, the problem was with node_modules permissions since it was created inside a Docker container.

$ ls -al
drwxr-xr-x    - root    10 Oct 12:39 node_modules

$ sudo chown martins:martins ./node_modules
$ sudo chmod -R 775 ./node_modules
$ ls -al
drwxrwxr-x    - martins 10 Oct 12:39 node_modules

And now it works. Unfortunately this hack of changing permissions needs to be done by hand right now which is not ideal 😞 Hopefully this can be fixed, automated or at least it should show a warning message to the user that there aren't enough permissions for node_modules. Otherwise the user is left in the dark.

@fwouts
Copy link
Owner

fwouts commented Oct 11, 2022

I see, thanks for figuring that out! Agree it's less than ideal.

I'm not familiar with Docker set-ups in VS Code, would you have some docs or an example repo I could look at?

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

2 participants