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

Build will not run properly if there is a hidden directory in the path #1107

Open
cyress opened this issue Nov 15, 2021 · 3 comments
Open

Build will not run properly if there is a hidden directory in the path #1107

cyress opened this issue Nov 15, 2021 · 3 comments
Labels

Comments

@cyress
Copy link

cyress commented Nov 15, 2021

First of all, I would like to thank you for this great project! ✌️

If the path to the current working directory contains a hidden directory (e.g. .fractal-workspace), the build process will not find the fractal components and the static export will not correct generated.

Steps to reproduce the issue

  1. Create a new hidden directory, e.g. in your user home directory.
    mkdir -p .fractal-workspace/main && cd .fractal-workspace/main
  2. Initialise project
    npm init -y && npm install --save @frctl/fractal
  3. Create Fractal project skeleton
    ./node_modules/.bin/fractal new test-project
    Answer all questions with yes (hit Enter)
  4. Set builder destination path in config
    cd test-project/ && echo "fractal.web.set('builder.dest', path.join(__dirname, 'build'));" >> fractal.config.js
  5. Run Fractal build-process
    NODE_ENV=debug ./node_modules/.bin/fractal build

Current result

  • The example component of the skeleton project isn't generated in the /build folder and also not referenced in the exported html files (e.g. index.html).
  • Only 6 items to be exported are found, but there must be 9.
⚑ Finished parsing components directory
⚑ Finished parsing docs directory
✔ Build started...
⚑ Exported '/' ==> '/index.html'
⚑ Exported 1 of 6 items
⚑ Exported 2 of 6 items
⚑ Exported 3 of 6 items
⚑ Exported 5 of 6 items
⚑ Exported 6 of 6 items
⚑ Copied '/Users/ms/.fractal-workspace/main/test-project/node_modules/@frctl/mandelbrot/dist' ==> '/Users/ms/.fractal-workspace/main/test-project/build/themes/mandelbrot'
✔ Build finished with no errors.

Expected result

  • If the path to the current working directory does not contain a hidden directory, the build process will run as expected and the example component will be generated.
  • You can just rename the folder for testing: cd ../../../ && mv .fractal-workspace fractal-workspace && cd fractal-workspace/main/test-project
  • And run the build again: NODE_ENV=debug ./node_modules/.bin/fractal build
⚑ Finished parsing docs directory
⚑ Finished parsing components directory
✔ Build started...
⚑ Exported '/assets' ==> '/assets.html'
⚑ Exported 1 of 9 items
⚑ Exported 2 of 9 items
⚑ Exported 3 of 9 items
⚑ Exported 5 of 9 items
⚑ Copied '/Users/ms/fractal-workspace/main/test-project/public' ==> '/Users/ms/fractal-workspace/main/test-project/build'
⚑ Exported 6 of 9 items
⚑ Exported 7 of 9 items
⚑ Exported 9 of 9 items
⚑ Copied '/Users/ms/fractal-workspace/main/test-project/node_modules/@frctl/mandelbrot/dist' ==> '/Users/ms/fractal-workspace/main/test-project/build/themes/mandelbrot'
✔ Build finished with no errors.

Reproduces how often:
Always

Context

  • Fractal version: 1.5.11
  • Node version: v16.8.0
  • OS: macOS 12.0.1 and Debian 11
@cyress cyress added the bug label Nov 15, 2021
@cyress
Copy link
Author

cyress commented Nov 29, 2021

Hello fractal devs! I hope you are well.
It would be great if you could have a look at this deviant behavior or possibly give a brief initial assessment as far as possible.
Thanks in advance!

@mihkeleidast
Copy link
Member

Hey, thanks for the report. I haven't had a chance to investigate or analyze this yet and quite frankly cannot promise when I can do so. I do remember something similar from the past, but did not manage to find it as of yet.

Can you maybe help prioritize this a bit - how important is the fix, can you use a workaround etc?

@cyress
Copy link
Author

cyress commented Nov 29, 2021

Thanks for your feedback!

It is not that urgent and i have already implemented a temporary workaround.
However, since it took me a few hours to figure out why the Fractal build process runs successfully, but no components are generated during the deployment, I thought it couldn't hurt to ask again. Also in the hope that others will be spared this in the future.

The workaround is, that i copied the normal GitLab Runner for projects with Fractal Integration and adjusted the configurations so that the build process is not executed in a hidden directory.
However, this means that changes to the runner- or deployment-configuration always have to be made in two places.
So this is not the optimal long-term solution, but it works for now.

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

No branches or pull requests

2 participants