-
Notifications
You must be signed in to change notification settings - Fork 75
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
Error when using esbuild@0.16.17 "Expected value for define "process.env.NODE_ENV" to be a string" #205
Comments
* refactor(web): migrate to moduleResolution node16 also revert cec630d because "imports" is not supported well enough yet * chore(deps): ignore updates for "esbuild" because of kentcdodds/mdx-bundler#205
In my case, this problem is fixed via installing |
I'm facing the same issue here. |
I had this same issue in a Remix application on mdx-bundler 10.0.1 and esbuild 0.20.1. I was able to fix it by adding this
|
expected this to work, unfortunately it didn't in my case for whatever reason was on esbuild |
mdx-bundler
version: 9.2.1node
version: 16.14.2npm
version: 7.17.0Relevant code or config
The example code from https://github.com/kentcdodds/mdx-bundler#usage.
What you did:
Installed
mdx-bundler
andesbuild
and ran the example code.What happened:
Reproduction repository:
https://stackblitz.com/edit/node-syqie8
Problem description:
mdx-bundler
defines'process.env.NODE_ENV'
here, via JSON.stringify:mdx-bundler/src/index.js
Line 179 in f1f4828
If the value
undefined
is passed toJSON.stringify
, it will return the valueundefined
(see mdn web docs).But
esbuild
expects a string instead. This was introduced in v0.16.0, see section "Add additional validation of API parameters" of https://github.com/evanw/esbuild/releases/tag/v0.16.0.Suggested solution:
Define
process.env.NODE_ENV
only if it is set.The text was updated successfully, but these errors were encountered: