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

Build fails when process is present #2

Closed
NorbertBodziony opened this issue Mar 11, 2022 · 2 comments
Closed

Build fails when process is present #2

NorbertBodziony opened this issue Mar 11, 2022 · 2 comments

Comments

@NorbertBodziony
Copy link

I got problem when i have defined process in vite config
define: { 'process.env': {} }
build throws:

[vite:plugin:bundled:entry:some_virtual_id] Build failed with 1 error:
error: Invalid define value (must be valid JSON syntax or a single identifier): [object Object]

Without define process works as expected

@gqio
Copy link
Member

gqio commented Mar 11, 2022

Hello,

I think for the define you need to pass a String.

for instance

define : { 'process.env': JSON.stringify({}) }

or

define : { 'process.env': '{}' }

@NorbertBodziony
Copy link
Author

Yeah that helps thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants