s-KaiNet / spfx-fast-serve

Improve your SharePoint Framework development flow by speeding up the "serve" command :rocket:
MIT License
135 stars 11 forks source link

Getting error when setting hotRefresh to true #105

Closed Leif-Frederiksen closed 1 year ago

Leif-Frederiksen commented 1 year ago

I have installed fast-serve on an SPFx 1.17 project. If I set hotRefresh to true in tast-serve/config.json like this:

{
  "$schema": "https://raw.githubusercontent.com/s-KaiNet/spfx-fast-serve/master/schema/config.latest.schema.json",
  "cli": {
    "isLibraryComponent": false
  },
  "serve": {
    "hotRefresh": true
  }
}

I get this error when running npm run serve:

C:\source\PI_Forretningsgange\node_modules\@pmmmwh\react-refresh-webpack-plugin\lib\index.js:104
        compiler.hooks.finishMake.tapPromise(
                                  ^

TypeError: Cannot read properties of undefined (reading 'tapPromise')
    at C:\source\PI_Forretningsgange\node_modules\@pmmmwh\react-refresh-webpack-plugin\lib\index.js:104:35
    at Array.forEach (<anonymous>)
    at ReactRefreshPlugin.apply (C:\source\PI_Forretningsgange\node_modules\@pmmmwh\react-refresh-webpack-plugin\lib\index.js:103:33)
    at Object.webpack [as default] (C:\source\PI_Forretningsgange\node_modules\spfx-fast-serve-helpers\node_modules\webpack\lib\webpack.js:51:13)
    at Object.<anonymous> (C:\source\PI_Forretningsgange\node_modules\spfx-fast-serve-helpers\lib\webpack\devServer.js:24:43)
    at Generator.next (<anonymous>)
    at fulfilled (C:\source\PI_Forretningsgange\node_modules\spfx-fast-serve-helpers\lib\webpack\devServer.js:5:58)

Any suggestions on what is wrong?

Best regards Leif

s-KaiNet commented 1 year ago

I haven't check how hot refresh works for some time now. Maybe it was broken after recent SPFx updates, I will check what might be wrong there.

s-KaiNet commented 1 year ago

Please try versions npm i spfx-fast-serve-helpers@1.17.3 -DE or npm i spfx-fast-serve-helpers@1.16.5 -DE depending on your SPFx version.

Leif-Frederiksen commented 1 year ago

It works - thank you for handling this :-)

/Leif

Den ons. 12. jul. 2023 kl. 16.03 skrev Sergei Sergeev < @.***>:

Please try versions npm i @. -DE or npm i @. -DE depending on your SPFx version.

— Reply to this email directly, view it on GitHub https://github.com/s-KaiNet/spfx-fast-serve/issues/105#issuecomment-1632590257, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGABXNIMJIWA7DGWCXBOORLXP2VBNANCNFSM6AAAAAA2EHB5BE . You are receiving this because you authored the thread.Message ID: @.***>

s-KaiNet commented 1 year ago

Glad it works, closing.