Hi 👋
On the latest version, a modification (somewhere around here) broke the metro bundler in production mode (and possibly other production apps? It's not tied to minification, but I didn't tried on other bundlers).

urql version: 1.9.7
Steps to reproduce
- Create a new React Native project
- Add
urql@1.9.7, wrap your app in a Provider with an urql client
- Build your app for production
- Starts your app. It will crash at client init.
Expected behavior
No JS ReferenceError.
Actual behavior
For some reason, the variable is not declared.
Debugging
In order to spot the issue, I created a server to serve the unminified production bundle to my debug application. Create a file at project root:
// server.js
const express = require("express");
const app = express();
app.use((req, res, next) => {
console.log(req.url);
res.setHeader("Content-Type", "application/javascript");
next();
});
app.use("/", express.static("."));
app.use("/assets", express.static("."));
app.get("/status", (_req, res) => {
res.send("packager-status:running");
});
app.listen(8081, () => {
console.log("Serving directory as localhost:8081");
});
Build a bundle with:
yarn react-native bundle --entry-file index.js --bundle-output index.bundle --platform ios --dev false --minify false
Then run the server.js file to fake metro bundler, it will be easier to debug.
Fix
The missing declaration is f:

If I add it manually to the bundle, it works:

Hi 👋
On the latest version, a modification (somewhere around here) broke the metro bundler in production mode (and possibly other production apps? It's not tied to minification, but I didn't tried on other bundlers).
urql version:
1.9.7Steps to reproduce
urql@1.9.7, wrap your app in aProviderwith an urql clientExpected behavior
No
JS ReferenceError.Actual behavior
For some reason, the variable is not declared.
Debugging
In order to spot the issue, I created a server to serve the unminified production bundle to my debug application. Create a file at project root:
Build a bundle with:
Then run the
server.jsfile to fake metro bundler, it will be easier to debug.Fix
The missing declaration is
f:If I add it manually to the bundle, it works: