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

variables are imported twice when use npm run dev #12819

Closed
7 tasks done
comhon-project opened this issue Apr 10, 2023 · 1 comment
Closed
7 tasks done

variables are imported twice when use npm run dev #12819

comhon-project opened this issue Apr 10, 2023 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@comhon-project
Copy link

comhon-project commented Apr 10, 2023

Describe the bug

after i have launched npm run dev.
when I look the console -> network
there are two fetched files that contain same variable from the same original file (Schema.js).

from http://localhost:5173/node_modules/.vite/deps/@query-kit_vue.js?v=9aa49d8f

...
// node_modules/@query-kit/vue/src/core/Schema.js
var schemaLoader;
...

from http://localhost:5173/node_modules/@query-kit/vue/src/core/Schema.js?v=9aa49d8f

...
let schemaLoader;
...

there is a function compute(name) that fails because it takes in account second variable but it's the first one that contain the good value.

it happens only on npm run dev. when i run npm run preview it works fine.

Reproduction

https://github.com/comhon-project/test-query-kit

Steps to reproduce

Run npm install followed by npm run dev

open the console and you will see an error :

Uncaught (in promise) TypeError: schemaLoader is undefined

System Info

System:
    OS: Linux 5.19 Ubuntu 22.04.2 LTS 22.04.2 LTS (Jammy Jellyfish)
    CPU: (8) x64 Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
    Memory: 6.24 GB / 15.49 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 16.13.2 - ~/.nvm/versions/node/v16.13.2/bin/node
    npm: 8.16.0 - ~/.nvm/versions/node/v16.13.2/bin/npm
  Browsers:
    Chrome: 111.0.5563.146
    Firefox: 111.0.1
  npmPackages:
    @vitejs/plugin-vue: ^4.0.0 => 4.1.0 
    vite: ^4.1.4 => 4.2.1

Used Package Manager

npm

Logs

No response

Validations

@sapphi-red
Copy link
Member

Duplicate of #3910

@sapphi-red sapphi-red marked this as a duplicate of #3910 Apr 11, 2023
@sapphi-red sapphi-red closed this as not planned Won't fix, can't repro, duplicate, stale Apr 11, 2023
@sapphi-red sapphi-red added duplicate This issue or pull request already exists and removed pending triage labels Apr 11, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Apr 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants