@preact/signals-react crashes on production build, at least using `react-scripts build`
See original GitHub issuecf: https://github.com/preactjs/signals/issues/86
The error here is: TypeError: Invalid value used as weak map key
What appears to be the case is that internals.ReactCurrentOwner.current
is not set.
Here are the versions I have installed:
"@preact/signals-react": "^1.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"typescript": "^4.4.2",
and the browser configuration:
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
How to reproduce:
- using
create-react-app
(typescript
template), create a react app - use
@preact/signals-react
yarn build
(creates a production build)- open your built browser-app in the browser
- behold this error
Issue Analytics
- State:
- Created a year ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
React App crashes when running the production build
My React app was crashing on only one specific screen on the production build, but not in the dev environment.
Read more >Everything you need to know about react-scripts
In this guide, we'll give an overview of react-scripts, compare a few different types of scripts, and describe how Create React App ...
Read more >Advanced Configuration
Variable Development Production
BROWSER ✓ Used 🚫 Ignored
BROWSER_ARGS ✓ Used 🚫 Ignored
HOST ✓ Used 🚫 Ignored
Read more >create-react-app crashes when editing files in emacs
To create a production build, use yarn build. /path-to-project/node_modules/react-scripts/scripts/start.js:19 throw err; ^ [Error: ENOENT: ...
Read more >How to resolve the memory heap out issue in React App
... memory heap out issue that occurs while building the React application ... "react-scripts --max_old_space_size=4096 start", "build": "react-scripts ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It also crashes when building using Vite.
@dackom let’s open a new issue for that as it’s different from the one originally reported here.