p5.js-website icon indicating copy to clipboard operation
p5.js-website copied to clipboard

Examples are not being generated with 'watch' script

Open aceslowman opened this issue 3 years ago • 9 comments

Most appropriate sections of the p5.js website?

Examples

What is your operating system?

Windows

Web browser and version

103.0.5060.114 (Official Build) (64-bit) (cohort: Stable)

Actual Behavior

When following the 'setup' and 'running' instructions in the readme, the npm run watch script generates examples/index.html, but none of the individual examples. All example pages, such as http://localhost:9000/examples/3d-basic-shader.html, return Cannot GET /examples/3d-basic-shader.html. All other pages, including reference pages, appear to be generated properly.

This might be some confusion or misconfiguration on my end, and if appropriate I'd like to update the readme to help others who run into the same issue.

Expected Behavior

I expect the individual example pages to be generated when either the npm run watch or npm run assemble commands are run.

Steps to reproduce

I forked p5.js-website, confirmed that Java is installed, ran npm install then npm run watch. Then, I navigated to http://localhost:9000/examples/, which displays properly, after which all individual examples return the same error.

Would you like to work on the issue?

If appropriate I'd be happy to update the readme with more info

aceslowman avatar Jul 13 '22 20:07 aceslowman

Yes, I am also getting the same error.

image

adarrssh avatar Jul 14 '22 15:07 adarrssh

I'm not able to replicate this. Can you check that in the generated dist/examples/ folder there are generated example html files? If not does running npm run build generates them?

limzykenneth avatar Jul 16 '22 07:07 limzykenneth

@limzykenneth, there is only a single html file in dist/examples/ even after running the npm run build

image

adarrssh avatar Jul 16 '22 14:07 adarrssh

@adarrssh Are you on the latest commit with no changes in the local repo? There is no other steps to build the examples than npm run build so if you cannot build with it, it's more than just the watch script problem.

limzykenneth avatar Jul 17 '22 05:07 limzykenneth

Yes, I am not the latest commit with no changes in the local repo.

adarrssh avatar Jul 17 '22 08:07 adarrssh

Is this Git changing line endings on Windows again?

https://github.com/processing/p5.js-website/issues/430#issuecomment-474461235

takyano avatar Jul 17 '22 21:07 takyano

@takyano thanks for bringing this up, it appears that this was the problem! After running git config core.autocrlf false and doing a full refresh of my fork, it appears that the pages are being assembled properly.

Would there be any value in including a .gitattributes file to disable autocrlf for the repository?

aceslowman avatar Jul 18 '22 15:07 aceslowman

Would there be any value in including a .gitattributes file to disable autocrlf for the repository?

I think that would help. You can file a PR for this if you like.

limzykenneth avatar Jul 19 '22 04:07 limzykenneth

Now it's working, thanks @takyano.

adarrssh avatar Jul 19 '22 08:07 adarrssh