-
-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Closed
Labels
inconsistencyInconsistency between dev & buildInconsistency between dev & buildp2-edge-caseBug, but has workaround or limited in scope (priority)Bug, but has workaround or limited in scope (priority)pending triage
Description
Describe the bug
When importing the package react-mapbox-wrapper, it behaves differently when used in development and production.
Given the following code:
import * as M from "react-mapbox-wrapper";
console.log(`M`, M);
running vite
outputs:
running vite build && vite preview
outputs:
Reproduction
- clone https://github.com/Newbie012/vite-bug-1
npm install
npm run dev
- see that the console.log that mentioned above exports accordingly
npm run build
npm run preview
- see that the console.log logs a module which its default module is itself
System Info
System:
OS: Linux 4.19 Ubuntu 20.04.1 LTS (Focal Fossa)
CPU: (16) x64 AMD Ryzen 7 5800X 8-Core Processor
Memory: 14.32 GB / 24.99 GB
Container: Yes
Shell: 5.8 - /usr/bin/zsh
Binaries:
Node: 12.22.6 - ~/.nvm/versions/node/v12.22.6/bin/node
npm: 6.14.15 - ~/.nvm/versions/node/v12.22.6/bin/npm
npmPackages:
@vitejs/plugin-legacy: 1.6.4 => 1.6.4
@vitejs/plugin-react: 1.1.3 => 1.1.3
vite: 2.7.2 => 2.7.2
Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Metadata
Metadata
Assignees
Labels
inconsistencyInconsistency between dev & buildInconsistency between dev & buildp2-edge-caseBug, but has workaround or limited in scope (priority)Bug, but has workaround or limited in scope (priority)pending triage