-
Notifications
You must be signed in to change notification settings - Fork 10
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
filenames that include existing directory name in the filename causes compilation error #132
Comments
I think we might need to add
Tried them individually as well and same issue. Suspiciously, the Probably should try and look into this, as for code based documentation (like the website), this could a relatively major issue. |
@hutchgrant |
opened the PR to document this for now at least |
Was working on #115 and was playing around with ERROR in ./www/components/header/header.js
Module not found: Error: Can't resolve '/queri/Users/owenbuckley/Workspace/project-evergreen/repos/greenwood/www/pages.gql' in '/Users/owenbuckley/Workspace/project-evergreen/repos/greenwood/www/components/header'
@ ./www/components/header/header.js 5:0-49 14:17-27
@ ./.greenwood/index/index.js
@ ./.greenwood/app/app.js
@ multi webpack-dev-server/client?http://localhost:1984 ./.greenwood/app/app.js Eventually I remembered this issue so I figured I would take a look into it since I could see this getting more annoying as page creation becomes more dynamic (e.g. #21 ). So spent a couple hours and I'm pretty sure the entire solution comes to a one character change as after a bunch of trial and error, it dawned on me what would be different between a file called pages, and a directory called pages. A // before
new RegExp(`${directory}`), (resource) => {
// after
new RegExp(`${directory}\/`), (resource) => { Playing around with it looking good. Will try out a couple more tests and open a PR soon if all looks good. |
Also, I think I was able to narrow down the use case. Essentially the issue is that if you have www/
pages/
about.md And then create something like www/
pages/
about.md
queries/
pages.js This will end up having the resource request to queries/pages.js will match against the directory mapping for pages/, and NOT queries/ (as you would expect). In essence, filenames that include a directory name in them will not get mapped to the correct parent directory. So it's not a set list per se, but rather whatever your folders structure is. Of course everyone will have a pages/ and templates/ directory so that will happen across the board. |
Type of Change
Summary
If you name a file
creating-pages.md
in the pages directory, it will throw an error that the file wasn't found.Details
I think this error is related to a regex when we're looking for files within the
pages
directory.edit: Same bug also we cannot use the word
templates
(with an s) within a filename. It seemspages
andtemplates
are reserved words.The text was updated successfully, but these errors were encountered: