Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'> c4builder site --watch' - fix for crash if files are modified. #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

biznuge
Copy link

@biznuge biznuge commented Jul 9, 2023

Found an annoying issue where modifying files in the src project tends to crash the running localhost:3000 site.

Replicating the bug

In an existing C4Builder project, Run a local site with watch enabled

c4builder site --watch

Once your site is up and running, change one of the following inside your ./src folder:-

  • A folder Name
  • A .md file name
  • A .puml file name
  • An image file [.png,.jpg,etc]

You should encounter the following error:-

C:\Tools\node\node-v16.15.0-win-x64\node_modules\c4builder\build.js:135
    let oldChecksums = conf.get('checksums') || [];
                            ^

TypeError: Cannot read properties of undefined (reading 'get')
    at generateImages (C:\Tools\node\node-v16.15.0-win-x64\node_modules\c4builder\build.js:135:29)
    at build (C:\Tools\node\node-v16.15.0-win-x64\node_modules\c4builder\build.js:770:15)
    at async Watcher.<anonymous> (C:\Tools\node\node-v16.15.0-win-x64\node_modules\c4builder\cli.js:140:21)

This seems to be due to conf not being passed to build() method at line:140 in ./cli.js.

Passing in conf appears to fix this problem.

Tested on:-

  • MacOS 13 (Silicon)
  • Windows 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant