-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Closed
Labels
p4-importantViolate documented behavior or significantly improves performance (priority)Violate documented behavior or significantly improves performance (priority)
Milestone
Description
Describe the bug
Vite seems to prioritize the module
field instead of the exports
like node does when importing from a library.
I found this problem while using Firebase with Nuxt: it failed during dev but worked after building the project for production and serving the app with node. These are the other issues I found
- Firebase - Could not reach Cloud Firestore backend nuxt/nuxt#14608
- firebase-js-sdk 9 behaviours different in nuxt 3 prod build and dev mode nuxt/nuxt#13393
- Preparing SSR for General Availability: Problematic Dependencies and API Improvements #4230 (reply in thread)
Reproduction
https://stackblitz.com/edit/vitejs-vite-csrnaz
Steps to reproduce
npm i
+npm run dev
-> outputs modulenode main.js
-> outputs exports
It should always output exports
System Info
na
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 vuejs/core 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
p4-importantViolate documented behavior or significantly improves performance (priority)Violate documented behavior or significantly improves performance (priority)