Scully: Installation of scully-plugin-flash-prevention

Created on 3 Mar 2020  ·  2Comments  ·  Source: scullyio/scully

🐞 Bug report

Description

Getting some errors trying out scully-plugin-flash-prevention. The module can't be found due to a wrong path to public-api.js. Also the registerPlugin import path in flash-prevention.plugin.js seems to be wrong. I fixed both of these issues in my local scully installation and the scully command is working again.

For the plugin to work, we also have to add alwaysMonitor: true to the ScullyLibModuleconfiguration in app.module.ts. This is not yet available in version @scullyio/[email protected]`

ScullyLibModule.forRoot({
     ...
     alwaysMonitor: true
     ...
    }),

🔬 Minimal Reproduction

Follow the Getting Started section in Flash-Prevention-Plugin Readme

💻Your Environment

Angular Version:




     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 9.0.3
Node: 13.3.0
OS: darwin x64

Angular: 9.0.2
... animations, 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.3
@angular-devkit/build-angular     0.900.3
@angular-devkit/build-optimizer   0.900.3
@angular-devkit/build-webpack     0.900.3
@angular-devkit/core              9.0.3
@angular-devkit/schematics        9.0.3
@angular/cli                      9.0.3
@ngtools/webpack                  9.0.3
@schematics/angular               9.0.3
@schematics/update                0.803.25
rxjs                              6.5.4
typescript                        3.7.5
webpack                           4.41.2

Scully Version:




"@scullyio/ng-lib": "0.0.19"
"@scullyio/scully": "0.0.78"

🔥 Exception or Error




Error: Cannot find module '/Users/garygrossgarten/Dev/notiz/notiz.dev/node_modules/scully-plugin-flash-prevention/src/public-apis.js'. Please verify that the package.json has a valid "main" entry
    at tryPackage (internal/modules/cjs/loader.js:313:19)
    at Function.Module._findPath (internal/modules/cjs/loader.js:689:18)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:948:27)
    at Function.Module._load (internal/modules/cjs/loader.js:854:27)
    at Module.require (internal/modules/cjs/loader.js:1023:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object. (/Users/garygrossgarten/Dev/notiz/notiz.dev/scully.notiz.config.js:1:46)
    at Module._compile (internal/modules/cjs/loader.js:1128:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Module.load (internal/modules/cjs/loader.js:983:32) {
  code: 'MODULE_NOT_FOUND',
  path: '/Users/garygrossgarten/Dev/notiz/notiz.dev/node_modules/scully-plugin-flash-prevention/package.json',
  requestPath: 'scully-plugin-flash-prevention'
}

and




Error: Cannot find module '../../../../dist/scully'
Require stack:
- /Users/garygrossgarten/Dev/notiz/notiz.dev/node_modules/scully-plugin-flash-prevention/src/lib/flash-prevention.plugin.js
- /Users/garygrossgarten/Dev/notiz/notiz.dev/node_modules/scully-plugin-flash-prevention/src/public-api.js
- /Users/garygrossgarten/Dev/notiz/notiz.dev/scully.notiz.config.js
- /Users/garygrossgarten/Dev/notiz/notiz.dev/node_modules/@scullyio/scully/utils/compileConfig.js
- /Users/garygrossgarten/Dev/notiz/notiz.dev/node_modules/@scullyio/scully/utils/config.js
- /Users/garygrossgarten/Dev/notiz/notiz.dev/node_modules/@scullyio/scully/routerPlugins/contentFolderPlugin.js
- /Users/garygrossgarten/Dev/notiz/notiz.dev/node_modules/@scullyio/scully/pluginManagement/systemPlugins.js
- /Users/garygrossgarten/Dev/notiz/notiz.dev/node_modules/@scullyio/scully/scully.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:961:17)
    at Function.Module._load (internal/modules/cjs/loader.js:854:27)
    at Module.require (internal/modules/cjs/loader.js:1023:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object. (/Users/garygrossgarten/Dev/notiz/notiz.dev/node_modules/scully-plugin-flash-prevention/src/lib/flash-prevention.plugin.js:1:26)
    at Module._compile (internal/modules/cjs/loader.js:1128:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Module.load (internal/modules/cjs/loader.js:983:32)
    at Function.Module._load (internal/modules/cjs/loader.js:891:14)
    at Module.require (internal/modules/cjs/loader.js:1023:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/garygrossgarten/Dev/notiz/notiz.dev/node_modules/scully-plugin-flash-prevention/src/lib/flash-prevention.plugin.js',
    '/Users/garygrossgarten/Dev/notiz/notiz.dev/node_modules/scully-plugin-flash-prevention/src/public-api.js',
    '/Users/garygrossgarten/Dev/notiz/notiz.dev/scully.notiz.config.js',
    '/Users/garygrossgarten/Dev/notiz/notiz.dev/node_modules/@scullyio/scully/utils/compileConfig.js',
    '/Users/garygrossgarten/Dev/notiz/notiz.dev/node_modules/@scullyio/scully/utils/config.js',
    '/Users/garygrossgarten/Dev/notiz/notiz.dev/node_modules/@scullyio/scully/routerPlugins/contentFolderPlugin.js',
    '/Users/garygrossgarten/Dev/notiz/notiz.dev/node_modules/@scullyio/scully/pluginManagement/systemPlugins.js',
    '/Users/garygrossgarten/Dev/notiz/notiz.dev/node_modules/@scullyio/scully/scully.js'
  ]
}
bug

Most helpful comment

@garygrossgarten, the plugin Author (@aaronfrost ) is already working on this issue. It needs a little build pipeline to work both on NPM, and inside our repo.
Thanks for reporting

All 2 comments

See PR #351

@garygrossgarten, the plugin Author (@aaronfrost ) is already working on this issue. It needs a little build pipeline to work both on NPM, and inside our repo.
Thanks for reporting

Was this page helpful?
0 / 5 - 0 ratings