elm-pages icon indicating copy to clipboard operation
elm-pages copied to clipboard

Content file names can conflict with content directory names

Open antoine-atmire opened this issue 6 years ago • 0 comments

The error as it appears:

$ elm-pages develop --port 3001
Running elm-pages...
/Users/antoine/Documents/projects/elm/elm-pages-tryout/node_modules/elm-pages/generator/src/generate-records.js:202
      if (name in obj) {
               ^

TypeError: Cannot use 'in' operator to search for 'src' in (buildPage [ "static-git", "files" ])
    at captureRouteRecord (/Users/antoine/Documents/projects/elm/elm-pages-tryout/node_modules/elm-pages/generator/src/generate-records.js:202:16)
    at generate (/Users/antoine/Documents/projects/elm/elm-pages-tryout/node_modules/elm-pages/generator/src/generate-records.js:85:7)
    at wrapper (/Users/antoine/Documents/projects/elm/elm-pages-tryout/node_modules/elm-pages/generator/src/generate-records.js:9:10)
    at run (/Users/antoine/Documents/projects/elm/elm-pages-tryout/node_modules/elm-pages/generator/src/elm-pages.js:47:24)
    at Object.<anonymous> (/Users/antoine/Documents/projects/elm/elm-pages-tryout/node_modules/elm-pages/generator/src/elm-pages.js:126:1)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

My (simplified) content directory structure:

✔ $ tree content
content
├── index.projects
└── static-git
    ├── files
    │   └── src
    │       ├── Commit.file
    │       └── Common.file
    ├── files.files
    └── static-git.history

3 directories, 5 files

Removing the content/static-git/files.files file makes it compile.

antoine-atmire avatar Nov 29 '19 13:11 antoine-atmire