Skip to content
This repository has been archived by the owner on Jun 27, 2022. It is now read-only.

warning: "No name was provided for external module..." #4

Closed
BryanWilhite opened this issue Feb 16, 2019 · 7 comments
Closed

warning: "No name was provided for external module..." #4

BryanWilhite opened this issue Feb 16, 2019 · 7 comments
Assignees

Comments

@BryanWilhite
Copy link
Owner

> ng build @songhay/player-video-you-tube

Building Angular Package
Building entry point '@songhay/player-video-you-tube'
Compiling TypeScript sources through ngc
Bundling to FESM2015
Bundling to FESM5
Bundling to UMD
No name was provided for external module 'songhay-core/utilities/css.utility' in output.globals – guessing 'css_utility'
No name was provided for external module 'lodash' in output.globals – guessing 'lodash_'
No name was provided for external module 'moment' in output.globals – guessing 'moment_'
No name was provided for external module 'songhay-core/utilities/dom.utility' in output.globals – guessing 'dom_utility'
No name was provided for external module '@songhay/core' in output.globals – guessing 'core'
Minifying UMD bundle
Side effects in initialization of unused variable lb [0:826,20]
@BryanWilhite BryanWilhite self-assigned this Feb 16, 2019
@BryanWilhite
Copy link
Owner Author

BryanWilhite commented Feb 16, 2019

this StackOverflow question: https://stackoverflow.com/a/53521270/22944 says add lib.umdModuleIds to ng-package.json

ng-packagr/ng-packagr#716 (comment)

BryanWilhite added a commit that referenced this issue Feb 16, 2019
BryanWilhite added a commit that referenced this issue Feb 19, 2019
@BryanWilhite
Copy link
Owner Author

getting error trying to build Songhay.Dashboard:

WARNING in ../songhay-ng-workspace/songhay/node_modules/@angular/core/fesm5/core.js 18260:15-36
Critical dependency: the request of a dependency is an expression

WARNING in ../songhay-ng-workspace/songhay/node_modules/@angular/core/fesm5/core.js 18272:15-102
Critical dependency: the request of a dependency is an expression

ERROR in ../songhay-ng-workspace/songhay/dist/songhay/player-video-you-tube/fesm5/songhay-player-video-you-tube.js
Module not found: Error: Can't resolve '@songhay/core' in '..\songhay-ng-workspace\songhay\dist\songhay\player-video-you-tube\fesm5'

BryanWilhite added a commit that referenced this issue Feb 19, 2019
@BryanWilhite
Copy link
Owner Author

last change caused this error:

> songhay@0.0.0 build:player-video-you-tube ..\sourceRoot\songhay-ng-workspace\songhay
> ng build @songhay/player-video-you-tube

Building Angular Package
Building entry point '@songhay/player-video-you-tube'
Compiling TypeScript sources through ngc
Bundling to FESM2015
Bundling to FESM5
Bundling to UMD
Minifying UMD bundle
Side effects in initialization of unused variable lb [0:826,20]
Copying declaration files
Writing package metadata
Distributing npm packages with 'dependencies' is not recommended. Please consider adding songhay-core to 'peerDependencies' or remove it from 'dependencies'.

BUILD ERROR
Dependency songhay-core must be explicitly whitelisted.
Error: Dependency songhay-core must be explicitly whitelisted.
    at Object.keys.forEach.dep (..\sourceRoot\songhay-ng-workspace\songhay\node_modules\ng-packagr\lib\ng-v5\entry-point\write-package.transform.js:125:23)
    at Array.forEach (<anonymous>)
    at checkNonPeerDependencies (..\sourceRoot\songhay-ng-workspace\songhay\node_modules\ng-packagr\lib\ng-v5\entry-point\write-package.transform.js:119:44)
    at ..\sourceRoot\songhay-ng-workspace\songhay\node_modules\ng-packagr\lib\ng-v5\entry-point\write-package.transform.js:93:13
    at Generator.next (<anonymous>)
    at ..\sourceRoot\songhay-ng-workspace\songhay\node_modules\ng-packagr\lib\ng-v5\entry-point\write-package.transform.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (..\sourceRoot\songhay-ng-workspace\songhay\node_modules\ng-packagr\lib\ng-v5\entry-point\write-package.transform.js:3:12)    at writePackageJson (..\sourceRoot\songhay-ng-workspace\songhay\node_modules\ng-packagr\lib\ng-v5\entry-point\write-package.transform.js:74:12)
    at Object.<anonymous> (..\sourceRoot\songhay-ng-workspace\songhay\node_modules\ng-packagr\lib\ng-v5\entry-point\write-package.transform.js:41:11)

Dependency songhay-core must be explicitly whitelisted.
Error: Dependency songhay-core must be explicitly whitelisted.
    at Object.keys.forEach.dep (..\sourceRoot\songhay-ng-workspace\songhay\node_modules\ng-packagr\lib\ng-v5\entry-point\write-package.transform.js:125:23)
    at Array.forEach (<anonymous>)
    at checkNonPeerDependencies (..\sourceRoot\songhay-ng-workspace\songhay\node_modules\ng-packagr\lib\ng-v5\entry-point\write-package.transform.js:119:44)
    at ..\sourceRoot\songhay-ng-workspace\songhay\node_modules\ng-packagr\lib\ng-v5\entry-point\write-package.transform.js:93:13
    at Generator.next (<anonymous>)
    at ..\sourceRoot\songhay-ng-workspace\songhay\node_modules\ng-packagr\lib\ng-v5\entry-point\write-package.transform.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (..\sourceRoot\songhay-ng-workspace\songhay\node_modules\ng-packagr\lib\ng-v5\entry-point\write-package.transform.js:3:12)    at writePackageJson (..\sourceRoot\songhay-ng-workspace\songhay\node_modules\ng-packagr\lib\ng-v5\entry-point\write-package.transform.js:74:12)
    at Object.<anonymous> (..\sourceRoot\songhay-ng-workspace\songhay\node_modules\ng-packagr\lib\ng-v5\entry-point\write-package.transform.js:41:11)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! songhay@0.0.0 build:player-video-you-tube: `ng build @songhay/player-video-you-tube`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the songhay@0.0.0 build:player-video-you-tube script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     \AppData\Roaming\npm-cache\_logs\2019-02-19T03_54_22_578Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! songhay@0.0.0 build: `npm run build:core && npm run build:player-video-you-tube`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the songhay@0.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     \AppData\Roaming\npm-cache\_logs\2019-02-19T03_54_22_614Z-debug.log
The terminal process terminated with exit code: 1

@BryanWilhite
Copy link
Owner Author

@BryanWilhite
Copy link
Owner Author

i am seriously considering using nrwl based on the legends sung in this issue:

nrwl/nx#466

I think that the directory structure of an NX Workspace makes more sense: apps + libs, versus the default app in src and the rest (apps + libs) in projects. @beeman

We work closely with the CLI team, and Nx is basically a more opinionated layer on top of CLI. @jeffbcross

@BryanWilhite
Copy link
Owner Author

BryanWilhite commented Feb 20, 2019

before i try nrwl, there is the possibility of seeing improvement through the use of npm pack: https://blog.angularindepth.com/creating-a-library-in-angular-6-part-2-6e2bc1e14121

WARNING: The first time I built a library way back in days of yore, I knew just enough about npm to be dangerous. So I thought, “Wait. I can just npm install the project dist directory instead of the package. Then, when I update my code, my test application will automatically pick up the changes.” Only do this if you enjoy bashing your head against a wall as you struggle with strange errors about 3rd party imports. You have been warned. —Todd Palmer

@BryanWilhite
Copy link
Owner Author

this issue is effectively resolved here: BryanWilhite/Songhay.Dashboard#48

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

No branches or pull requests

1 participant