question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Freeze livereload in node_modules folder

See original GitHub issue

Describe the bug

If sveltekit root folder inside ./src/node_modules/svelte-kit live reload in dev mode don’t working…

Reproduction

Create sveltekit project inside node_modules folder & run svelte-kit dev

Logs

No response

System Info

System:
    OS: macOS 12.0
    CPU: (8) arm64 Apple M1
    Memory: 116.34 MB / 8.00 GB
    Shell: 3.3.1 - /opt/homebrew/bin/fish
  Binaries:
    Node: 16.9.0 - /opt/homebrew/bin/node
    npm: 7.21.1 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 93.0.4577.63
    Firefox: 92.0
    Firefox Developer Edition: 93.0
    Safari: 15.0
  npmPackages:
    @sveltejs/adapter-static: ^1.0.0-next.18 => 1.0.0-next.18 
    @sveltejs/kit: next => 1.0.0-next.165 
    svelte: ^3.34.0 => 3.42.5

Severity

annoyance

Additional Information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
bluwycommented, Sep 14, 2021

That’s a very unique usecase. I don’t think there’s anything SvelteKit can do at the moment to fix this, it would be an upstream issue in Vite, so we should send an issue up there instead and close this.

Though to be honest, I don’t think it’s worth the effort fixing in Vite either. Might be worth refactoring the old monorepo style to use workspaces, as Vite also has extra support for developing in workspaces.

2reactions
bluwycommented, Sep 12, 2021

Anything under node_modules isn’t watched by Vite by default, and there doesn’t seem to be a way to configure that. Plus a lot of Vite’s internal have assumptions on whether a path contains node_modules and work accordingly, so I’d guess it’s not a simple feature.

At the meantime you can use something like https://github.com/ElMassimo/vite-plugin-full-reload to watch that path, but it’ll do a full reload everytime the files there change. Another untested idea, is to only force Vite to watch those files like so so HMR could still work (not sure).

Read more comments on GitHub >

github_iconTop Results From Across the Web

webpack to also watch node modules for hot reloading is not ...
After this, if I am trying to make changes in cookie node-modules the webpack is not hot reloading. Here is my /** *...
Read more >
node_modules folder causes several minutes of lag ... - GitHub
The problem with this is that when I click "Show All Files", it tries to enumerate the directory structure of the entire node_modules...
Read more >
live-server - npm
This is a little development server with live reload capability. Use it for hacking your HTML/JavaScript/CSS files, but not for deploying ...
Read more >
Major system hangs while using eslint on save while also ...
if I disable eslint in vs code, live reload and webpack bundles ... It looks like it was dipping into the node_modules folder...
Read more >
Npm install doesn't complete inside docker container
I tried that this mornign but still receive the following (after removing node_modules and re-running npm install ): npm ERR! Linux 4.4.9-moby ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found