question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@preact/signals-react crashes on production build, at least using `react-scripts build`

See original GitHub issue

cf: https://github.com/preactjs/signals/issues/86

The error here is: TypeError: Invalid value used as weak map key

image

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:

  1. using create-react-app (typescript template), create a react app
  2. use @preact/signals-react
  3. yarn build (creates a production build)
  4. open your built browser-app in the browser
  5. behold this error

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
izznatsircommented, Sep 12, 2022

It also crashes when building using Vite.

0reactions
marvinhagemeistercommented, Sep 15, 2022

@dackom let’s open a new issue for that as it’s different from the one originally reported here.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found