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

vite build lose some code with special npm package #13907

Closed
7 tasks done
flyerH opened this issue Jul 20, 2023 · 1 comment · Fixed by #13909
Closed
7 tasks done

vite build lose some code with special npm package #13907

flyerH opened this issue Jul 20, 2023 · 1 comment · Fixed by #13909

Comments

@flyerH
Copy link

flyerH commented Jul 20, 2023

Describe the bug

When I import superagent module, part of js code in the dist was missing after build

image

Reproduction

https://stackblitz.com/edit/vitejs-vite-fek96t?file=main.js

Steps to reproduce

  1. open two terminals
  2. npm run dev
  3. npm run preview

The problem will be disappear, if import request from 'superagent'; is commented out

System Info

System:
    OS: macOS 13.4.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 508.16 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 14.18.1 - ~/.nvm/versions/node/v14.18.1/bin/node
    Yarn: 1.22.15 - ~/.yarn/bin/yarn
    npm: 8.18.0 - ~/.nvm/versions/node/v14.18.1/bin/npm
  Browsers:
    Chrome: 114.0.5735.198
    Edge: 114.0.1823.67
    Safari: 16.5.2

Used Package Manager

npm

Logs

No response

Validations

@stackblitz
Copy link

stackblitz bot commented Jul 20, 2023

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@flyerH flyerH changed the title vite build lose some code with special npm module vite build lose some code with special npm package Jul 20, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Aug 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant