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

Loading failed for the module with source “http://localhost/node_modules/.vite/xxx”. #7059

Closed
7 tasks done
Devecor opened this issue Feb 24, 2022 · 2 comments
Closed
7 tasks done

Comments

@Devecor
Copy link

Devecor commented Feb 24, 2022

Describe the bug

Hello,
I'm trying to access vite dev server via nginx reverse proxy to avoid CORS and getting stuck.

my nginx config:

server {
    listen 80 default_server;
    server_name localhost;

    location / {
        proxy_pass http://localhost:3000;
    }
    location /image {
        proxy_pass http://localhost:8001;
    }
}

it's possible to access vite dev server via http://localhost after nginx reload with this config. However, it says:

on chrome:

GET http://localhost/node_modules/.vite/element-plus_es.js?v=c48a10d4 net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK)

on firefox:

Loading failed for the module with source “http://localhost/node_modules/.vite/element-plus_es.js?v=c48a10d4”.

If I request http://localhost/node_modules/.vite/element-plus_es.js?v=c48a10d4 directly, it works well.

Reproduction

https://github.com/Devecor/vite-loading-failed-for-the-module-with-source

System Info

System:
    OS: macOS 12.2.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 19.74 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 8.3.1 - ~/.nvm/versions/node/v16.14.0/bin/npm
  Browsers:
    Chrome: 98.0.4758.102
    Firefox: 97.0.1
    Safari: 15.3

Used Package Manager

npm

Logs

No response

Validations

@bluwy
Copy link
Member

bluwy commented Feb 24, 2022

May be fixed by #6758

@patak-dev
Copy link
Member

Closing as stale, a lot has changed in deps prebundling. @Devecor if your issue persist please open a new bug report. Thanks!

@github-actions github-actions bot locked and limited conversation to collaborators May 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants