Unable to recompile in Frontity Dev mode

Hello,

I haven’t been active in a while as I have been busy with other projects. With that being said, I have been trying to come back to Frontity for some future projects but have run into a roadblock that I hope somebody can help me with. I am not sure if I am missing something, but I have tried everything I can think of, and nothing has solved the issue.

So with that being said, the issue I am running into is that when running npx frontity dev in a new project, it does not recompile when changes are made in the project. This is what I get in the terminal:

(node:11736) Warning: Closing file descriptor 3 on garbage collection
(Use `node --trace-warnings ...` to show where the warning was created)
(node:11736) [DEP0137] DeprecationWarning: Closing a FileHandle object on garbage collection is deprecated. Please close FileHandle objects explicitly using FileHandle.prototype.close(). In the future, an error will be thrown if a file descriptor is closed during garbage collection.
SERVER STARTED -- Listening @ http://localhost:3000
  - mode: development
  - target: module
  - public-path: /static/


webpack built client 92cfd5d96c66bd24764b in 18626ms
i 「wdm」: Hash: 92cfd5d96c66bd24764b86a64419a1d4379926d9
Version: webpack 4.46.0
Child client:
    Hash: 92cfd5d96c66bd24764b
    Time: 18626ms
    Built at: 06/10/2021 8:50:36 PM
                                  Asset      Size          Chunks
                 Chunk Names
         ../bundling/chunks.module.json  1.48 KiB                  [emitted]
                      archive.module.js  73.6 KiB         archive  [emitted]         archive
                 archive~post.module.js   156 KiB    archive~post  [emitted]         archive~post
           fonts/Inter-Bold-LATIN.woff2  32.9 KiB                  [emitted]
        fonts/Inter-Bold-US-ASCII.woff2  21.7 KiB                  [emitted]
                 fonts/Inter-Bold.woff2   136 KiB                  [emitted]
         fonts/Inter-Medium-LATIN.woff2  32.5 KiB                  [emitted]
      fonts/Inter-Medium-US-ASCII.woff2  21.3 KiB                  [emitted]
               fonts/Inter-Medium.woff2   134 KiB                  [emitted]
       fonts/Inter-SemiBold-LATIN.woff2  32.7 KiB                  [emitted]
    fonts/Inter-SemiBold-US-ASCII.woff2  21.5 KiB                  [emitted]
             fonts/Inter-SemiBold.woff2   135 KiB                  [emitted]
                         post.module.js  37.1 KiB            post  [emitted]         post
               smartbuildings.module.js     7 MiB  smartbuildings  [emitted]  [big]  smartbuildings
    Entrypoint smartbuildings [big] = smartbuildings.module.js
    [0] multi webpack-hot-middleware/client ./build/bundling/entry-points/smartbuildings/client.ts 40 bytes {smartbuildings} [built]
    [./build/bundling/entry-points/smartbuildings/client.ts] 1.3 KiB {smartbuildings} [built]
    [./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js] 926 bytes {smartbuildings} [built]
    [./node_modules/@frontity/connect/src/index.js] 243 bytes {smartbuildings} [built]
    [./node_modules/@frontity/core/src/client/index.tsx] 2.2 KiB {smartbuildings} [built]
    [./node_modules/@frontity/html2react/src/index.ts] 214 bytes {smartbuildings} [built]
    [./node_modules/@frontity/tiny-router/src/index.ts] 241 bytes {smartbuildings} [built]
    [./node_modules/@frontity/wp-source/src/index.ts] 1.45 KiB {smartbuildings} [built]
    [./node_modules/core-js/modules/es.string.replace.js] 3.96 KiB {smartbuildings} [built]
    [./node_modules/webpack-hot-middleware/client-overlay.js] (webpack)-hot-middleware/client-overlay.js 1.79 KiB {smartbuildings} [built]
    [./node_modules/webpack-hot-middleware/client.js] (webpack)-hot-middleware/client.js 6 KiB {smartbuildings} [built]
    [./node_modules/webpack-hot-middleware/node_modules/strip-ansi/index.js] (webpack)-hot-middleware/node_modules/strip-ansi/index.js 189 bytes {smartbuildings} [built]
    [./node_modules/webpack-hot-middleware/process-update.js] (webpack)-hot-middleware/process-update.js 3.39 KiB {smartbuildings} [built]
    [./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 497 bytes {smartbuildings} [built]
    [./packages/twentytwenty-theme/src/index.js] 2.08 KiB {smartbuildings} [built]
        + 354 hidden modules
Child server:
    Hash: 86a64419a1d4379926d9
    Time: 21924ms
    Built at: 06/10/2021 8:50:39 PM
        Asset      Size  Chunks                    Chunk Names
    server.js  9.28 MiB    main  [emitted]  [big]  main
    Entrypoint main [big] = server.js
    [./build/bundling/entry-points/server.ts] 529 bytes {main} [built]
    [./node_modules/@frontity/core/src/server/index.ts] 2.52 KiB {main} [built]
    [./node_modules/@frontity/core/src/server/middlewares/error-handling.ts] 500 bytes {main} [built]
    [./node_modules/@frontity/core/src/server/middlewares/scripts-stats.ts] 593 bytes {main} [built]
    [./node_modules/@frontity/core/src/server/middlewares/server-side-rendering.ts] 5.11 KiB {main} [built]
    [./node_modules/@frontity/core/src/server/middlewares/settings-and-store.ts] 1.66 KiB {main} [built]
    [./node_modules/@frontity/html2react/processors/image.tsx] 5.46 KiB {main} [built]
    [./node_modules/@frontity/html2react/processors/link.tsx] 709 bytes {main} [built]
    [./node_modules/@frontity/html2react/processors/script.tsx] 718 bytes {main} [built]
    [./node_modules/@frontity/html2react/src/index.ts] 214 bytes {main} [built]
    [./node_modules/@frontity/html2react/src/libraries/component.tsx] 7.98 KiB {main} [built]
    [./node_modules/@frontity/tiny-router/src/actions.ts] 9.14 KiB {main} [built]
    [./node_modules/@frontity/tiny-router/src/index.ts] 241 bytes {main} [built]
    [./node_modules/@frontity/wp-source/src/index.ts] 1.45 KiB {main} [built]
    [./packages/twentytwenty-theme/src/index.js] 2.08 KiB {main} [built]
        + 560 hidden modules
i 「wdm」: Compiled successfully.

I have tried installing a clean build of Frontity over two computers, I have tried using both the Mars Theme and the Twenty-Twenty theme. I have tried creating a new packaged theme and again that has not worked. I believe it may have something to do with the Garbage collector error, but I am at a loss of what is causing it. I have tried multiple new packages to see if maybe it was a problem during install, and it doesn’t seem to be the case.

I placed one of my fresh installs in this repo if it helps. Tikio88/smart-building.io (github.com)

Thank you in advance for the help!

That doesn’t look like an error. Are you accessing through localhost:3000?

does npm run dev also not work?

Also, and this may seem silly, but are you editing the right files?. I’ve sometimes done a search to edit a file only to find I’m editing the file from another project since the search was pointing to a different folder :S

1 Like

I am accessing through localhost:3000. I also tested port 4444 and 8000 just to make sure. I Also just tested npm run dev and the same issue occurs.

Not a silly question at all, I also thought I may have been editing the wrong files, but I have now tried with 5 separate new projects on different hard drives, and they all have the same issue. I also confirmed as when I edit the files, I ran npx frontity dev and I could see the change. The issue is that if I change the files again while the node developer server is running, it doesn’t rebuild the project, meaning it doesn’t update with my changes.

Have you tried update Frontity core?

Maybe also try different versions of node with nvm?

1 Like

I have tried updating Frontity core and following the steps to in the Docs. I have also tried the release version of Node and the LTS version of node. I am really at a loss for why the issue is occurring :cry:

Are they old projects ? Can you try it with a new Frontity install/project?

Yes, I have as stated in the first post! I’ve tried over 5 times now :open_mouth:

apologies! you did mention that to begin with.

what’s your development environment / operating system? eg working under WSL (Windows 10 Ubuntu etc) but accessing files via the Windows filesystem rather than the Ubuntu mount filesystem won’t work properly

@ShaGui actually I just installed your repo and have the same issue. my other projects are fine so trying to track down what’s different

update:
solution: create a new frontity project and install mars-theme when it asks you which theme to install. once it’s finished delete mars-theme from packages and replace with your version

there’s something in the old dependencies that’s seemingly breaking webpack and I’ve no idea what.

I’m wondering if the . in your folder name caused any linking issues

2 Likes

Hi @codemonkeynorth,

Thank you so much for all of your help and suggestions!

It is now working after starting a new project. I am unsure of what changed, I am looking into it now, but the period in the projects name is not the issue as I tested a few projects without the period in the name.

I am just as confused as you as to why webpack was breaking. That being said, since it is working all of a sudden, I am assuming something has been updated between my first post and today?

Either way, I will try and see if I can find what was causing the issue and will update the post if I do figure it out. Until, then, thank you again for all of your troubleshooting suggestions :slight_smile:

i´ve experienced the same issue and it is happening a couple of times a day now.
I have tried creating a new project and creating new package. It seemed to work for a while. Also tried everything on troubleshooting page (Keep Frontity Updated - Frontity Docs). Sometimes it works, sometimes not. At the moment i am stuck.

I am working with a colleague on the project. He doesn´t have the Problem.
Currently I have to delete my node modules and reinstall them. When i start the dev server i get updated state. But when I change my code I have to delete/reinstall them on every refresh.

We are working on a project with a tough timeline. Help is very much appreciated. I can add you to our github repo.

Downgrading frontity modules seems to work for me at the moment.
“@frontity/core”: “^1.9.1”,
“@frontity/html2react”: “^1.6.1”,
“@frontity/tiny-router”: “^1.3.2”,
“@frontity/wp-source”: “^1.11.1”,
“frontity”: “^1.14.1”,