-
-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Closed as not planned
Labels
feat: ssrp2-to-be-discussedEnhancement under consideration (priority)Enhancement under consideration (priority)
Description
Describe the bug
__filename
and __dirname
are undefined and cause a reference error in modules loaded with ssrLoadModule
. They work correctly in the production build.
Reproduction
https://stackblitz.com/edit/vitejs-vite-seqgmn?file=index.js
System Info
System:
OS: Linux 5.4 Linux Mint 20.3 (Una)
CPU: (8) x64 Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz
Memory: 793.16 MB / 15.52 GB
Container: Yes
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 16.13.1 - /usr/local/bin/node
Yarn: 1.22.11 - ~/.npm-global/bin/yarn
npm: 8.3.0 - ~/.npm-global/bin/npm
Browsers:
Chrome: 98.0.4758.80
Firefox: 97.0
npmPackages:
vite: ^2.8.1 => 2.8.1
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/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
feat: ssrp2-to-be-discussedEnhancement under consideration (priority)Enhancement under consideration (priority)