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

bug(ssr): process.env.xxx is undefined when calling ssrloadmodules api #5435

Closed
7 tasks done
zhangyuang opened this issue Oct 27, 2021 · 4 comments
Closed
7 tasks done

Comments

@zhangyuang
Copy link
Contributor

zhangyuang commented Oct 27, 2021

Describe the bug

From this pr which cause process.env.FOO is undefined in nodejs environment and we must use process.env['FOO'] to get the right value because process.env will be replaced with ({})

Reproduction

$ git clone git@github.com:zhangyuang/vite-ssr-error-require.git
$ git checkout bug/env

System Info

$ npx envinfo --system --npmPackages '{vite,@vitejs/*}' --binaries --browsers

  System:
    OS: macOS 10.15.4
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 278.79 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 14.17.2 - ~/.nvm/versions/node/v14.17.2/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.17.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 95.0.4638.54
    Safari: 13.1
  npmPackages:
    @vitejs/plugin-vue: ^1.0.0 => 1.9.3
    @vitejs/plugin-vue-jsx: ^1.0.0 => 1.2.0
    vite: ^2.6.11 => 2.6.11

Used Package Manager

yarn

Logs

No response

Validations

@bluwy
Copy link
Member

bluwy commented Oct 27, 2021

Duplicate of #3176

@zhangyuang
Copy link
Contributor Author

yeah, i have saw it right now

@bluwy
Copy link
Member

bluwy commented Oct 27, 2021

If so we should close this issue then.

@bluwy
Copy link
Member

bluwy commented Oct 28, 2021

This is now fixed in #5404

@Niputi Niputi closed this as completed Oct 28, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Nov 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants