-
-
Notifications
You must be signed in to change notification settings - Fork 861
Closed
Description
🐛 Bug Report
When using immer.esm.js on browser. We get
Uncaught ReferenceError: process is not defined
<script type="module" src="./testESM.js"></script>
import { produce } from "https://unpkg.com/immer@6.0.2/dist/immer.esm.js";
Declaring the variable ahead of time fixes the issue.
<script>
let process = {
env: {
NODE_ENV: "production"
}
};
</script>
Link to repro
Couldn't use code-sandbox because it wanted to import all modules as
node modules instead of as an esm module.
repo
To Reproduce
npm install . && npm test
Observed behavior
On import, throws
Uncaught ReferenceError: process is not defined
Expected behavior
Not throwing an exception
Environment
We only accept bug reports against the latest Immer version.
- Immer version: latest
- N/A Occurs with
setUseProxies(true)
- N/A Occurs with
setUseProxies(false)
(ES5 only)
Metadata
Metadata
Assignees
Labels
No labels