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

projectRoot missing in "scully.json" due to fs_extra_1.pathExists is not a function #28

Closed
Splaktar opened this issue Dec 16, 2019 · 7 comments · Fixed by #32
Closed

Comments

@Splaktar
Copy link
Contributor

Splaktar commented Dec 16, 2019

Steps to Reproduce

  1. ng add @scullyio/init
  2. ng build
  3. npm run scully

Error

npm run scully

TypeError: fs_extra_1.pathExists is not a function
    at Object.exports.compileConfig (/Users/splaktar/Git/.../node_modules/@scullyio/scully/bin/utils/compileConfig.js:15:32)
    at loadIt (/Users/splaktar/Git/.../node_modules/@scullyio/scully/bin/utils/config.js:15:50)
    at Object.<anonymous> (/Users/splaktar/Git/.../node_modules/@scullyio/scully/bin/utils/config.js:50:22)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/Users/splaktar/Git/.../node_modules/@scullyio/scully/bin/routerPlugins/contentFolderPlugin.js:6:18)
projectRoot missing in "scully.json"
No routes defined in "scully.config"

Looking at my scully.config.js file:

exports.config = {
  projectRoot: "./src/app",
  routes: {
  }
};

The projectRoot is defined and seems to be correct for my repo.

Since I don't have any routes that have params, do I need to define routes: {} in scully.config.js?

The error message seems to be referring to the wrong file name? scully.json

@Splaktar

This comment has been minimized.

@Splaktar

This comment has been minimized.

@Splaktar Splaktar changed the title projectRoot missing in "scully.json" projectRoot missing in "scully.json" due to fs_extra_1.pathExists is not a function Dec 16, 2019
@Splaktar
Copy link
Contributor Author

This appears to be caused by fs_extra_1.pathExists is not a function. I found the docs here, but they don't help explain why this wouldn't be a function.

@Splaktar
Copy link
Contributor Author

npm ls fs-extra gives me

├─┬ firebase-tools@7.10.0
│ ├── fs-extra@0.23.1 
│ └─┬ superstatic@6.0.4
│   └── fs-extra@0.30.0 
└─┬ karma@4.4.1
  └─┬ log4js@4.5.1
    └─┬ streamroller@1.0.6
      └── fs-extra@7.0.1 

But nothing from Scully. pathExists came out in fs-extra 6.0.0, so if it is using the fs-extra from firebase-tools, it won't exist. But if it gets the one from karma, it should...

@Splaktar
Copy link
Contributor Author

Adding "fs-extra": "^8.1.0", to devDependencies works around this issue. It looks like @scullyio/scully may need to add this as a dependency.

Splaktar added a commit to Splaktar/scully that referenced this issue Dec 16, 2019
- rename config file in error message to 'scully.config.js'

Fixes scullyio#28
@SanderElias
Copy link
Contributor

Thanks for the PR! Good find.
I still wonder why this doesn't pop up for ourselves tho.

@Splaktar
Copy link
Contributor Author

Not sure. I'm on macOS Catalina running the following

Angular CLI: 9.0.0-rc.6
Node: 12.13.0
OS: darwin x64

Angular: 9.0.0-rc.6
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.0-rc.6
@angular-devkit/build-angular     0.900.0-rc.6
@angular-devkit/build-optimizer   0.900.0-rc.6
@angular-devkit/build-webpack     0.900.0-rc.6
@angular-devkit/core              9.0.0-rc.6
@angular-devkit/schematics        9.0.0-rc.6
@angular/cdk                      9.0.0-rc.5
@angular/fire                     5.2.3
@angular/material                 9.0.0-rc.5
@ngtools/webpack                  9.0.0-rc.6
@schematics/angular               9.0.0-rc.6
@schematics/update                0.900.0-rc.6
rxjs                              6.5.3
typescript                        3.6.4
webpack                           4.41.2

SanderElias pushed a commit that referenced this issue Dec 18, 2019
- rename config file in error message to 'scully.config.js'

Fixes #28
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 a pull request may close this issue.

2 participants