parcel: Build without HMR fails with 'is not a function' type error

πŸ› bug report

πŸŽ› Configuration (.babelrc)

{
  "presets": [
    "env",
    "react"
  ]
}

πŸ€” Expected Behavior

Should work with production built or without HMR (parcel serve --no-hmr) the same as with HMR built.

😯 Current Behavior

After switching for cerebral-realworld-example-app from create-react-app to parcel I got a problem with the production build. With CRA and also with parcel developement build with HMR everything works fine, but when loading a production build or development build without HMR I get the following error:

react-dom.development.js:242 Uncaught TypeError: (0 , w.redirectToSignal) is not a function
    at Object.parcelRequire.113.cerebral (react-dom.development.js:242)
    at u (react-dom.development.js:1)
    at a (react-dom.development.js:1)
    at Object.parcelRequire.112.cerebral (react.development.js:180)
    at u (react-dom.development.js:1)
    at a (react-dom.development.js:1)
    at Object.parcelRequire.76.cerebral (react.development.js:136)
    at u (react-dom.development.js:1)
    at a (react-dom.development.js:1)
    at Object.parcelRequire.29.cerebral (react-dom.development.js:292)
parcelRequire.113.cerebral @ react-dom.development.js:242
u @ react-dom.development.js:1
a @ react-dom.development.js:1
parcelRequire.112.cerebral @ react.development.js:180
u @ react-dom.development.js:1
a @ react-dom.development.js:1
parcelRequire.76.cerebral @ react.development.js:136
u @ react-dom.development.js:1
a @ react-dom.development.js:1
parcelRequire.29.cerebral @ react-dom.development.js:292
u @ react-dom.development.js:1
a @ react-dom.development.js:1
parcelRequire.9.cerebral @ react-dom.development.js:294
u @ react-dom.development.js:1
a @ react-dom.development.js:1
parcelRequire.7.react @ react-dom.development.js:402
u @ react-dom.development.js:1
parcelRequire.43 @ react-dom.development.js:1
(anonymous) @ react-dom.development.js:1

You can see that error live when opening http://conduit.yacoma.it/#/. After removing all instances of redirectToSignal the app loads also fine for production. BUT for the TestApp which also uses redirectToSignal the production build loads also fine. So I was not able to isolate the issue.

πŸ’ Possible Solution

Don’t know as I was not able to isolate the issue.

πŸ’» Code Sample

The instance of redirectToSignal which errors now you can find here. But when removing this one the next instance errors.

In the test_parcel branch I have removed all instances of redirectToSignal and it loads fine.

I created a TestApp which also uses redirectToSignal to isolate the problem, but surprisingly it loads fine.

🌍 Your Environment

Software Version(s)
Parcel 1.7.0
Node 8.11.1
npm 5.8.0
Operating System Linux Debian Stretch

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (5 by maintainers)

Most upvoted comments

Just tried out the fix in #1011 and it fixes this issue.

@DeMoorJasper Ok getting one step further. When running parcel serve --no-hmr I get exactly the same issue. So it is related to hmr or actually to missing hmr not to production built.