plasmo icon indicating copy to clipboard operation
plasmo copied to clipboard

[BUG] Uncaught TypeError: $RefreshSig$ is not a function

Open DanielRuf opened this issue 1 year ago • 6 comments

What happened?

Getting an error when yarn dev is used and we have a HOC function component with hooks

...
        "@parcel/transformer-react-refresh-wrap/lib/helpers/helpers.js": "d37mJ"
    }],
    "jU5yN": [function(require, module, exports) {
        var $parcel$ReactRefreshHelpers$efaa = require("@parcel/transformer-react-refresh-wrap/lib/helpers/helpers.js");
        var prevRefreshReg = window.$RefreshReg$;
        var prevRefreshSig = window.$RefreshSig$;
        $parcel$ReactRefreshHelpers$efaa.prelude(module);

        try {
            var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");
            parcelHelpers.defineInteropFlag(exports);
            parcelHelpers.export(exports, "ComponentNew", ()=>ComponentNew);
            var _react = require("react");
            var _reactDefault = parcelHelpers.interopDefault(_react);
            var _hook = require("@plasmohq/storage/hook");
            ...
            var _logger = require("~loggers/Logger");
            var _helpers = require("~util/helpers");
            var _s = $RefreshSig$();
            const ComponentNew = (props)=>{
                _s();
                var _s1 = $RefreshSig$() <=== here it throws
                  , _s2 = $RefreshSig$()
                  , _s3 = $RefreshSig$();

In the browser console:

content.ffb82774.js:54859 Uncaught TypeError: $RefreshSig$ is not a function
    at ComponentNew (content.ffb82774.js:54859:15)
    at renderWithHooks (content.ffb82774.js:15519:24)
    at mountIndeterminateComponent (content.ffb82774.js:18381:17)
    at beginWork (content.ffb82774.js:19411:24)

Version

Latest

What OS are you seeing the problem on?

Linux

What browsers are you seeing the problem on?

Chrome

Relevant log output

No response

(OPTIONAL) Contribution

  • [ ] I would like to fix this BUG via a PR

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct
  • [X] I checked the current issues for duplicate problems.

DanielRuf avatar Jul 31 '23 23:07 DanielRuf