question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

export 'default' (imported as 'core') was not found in '@angular/core'

See original GitHub issue

Type of Issue

[ ] Bug Report
[ ] Feature Request
[*] I'm stuck

Description

What could be the reson of the issue:

WARNING in ./node_modules/@scope/common/@scope/common.es5.js
72496:41-45 "export 'default' (imported as 'core') was not found in '@angular/core'
    at HarmonyImportSpecifierDependency._getErrors (C:\Projects\SCOPE\scope_concrete\node_modules\webpack\lib\dependencies\HarmonyImportSpecifierDependency.js:65:15)
    at HarmonyImportSpecifierDependency.getWarnings (C:\Projects\SCOPE\scope_concrete\node_modules\webpack\lib\dependencies\HarmonyImportSpecifierDependency.js:39:15)
    at Compilation.reportDependencyErrorsAndWarnings (C:\Projects\SCOPE\scope_concrete\node_modules\webpack\lib\Compilation.js:703:24)
    at Compilation.finish (C:\Projects\SCOPE\scope_concrete\node_modules\webpack\lib\Compilation.js:561:9)
    at applyPluginsParallel.err (C:\Projects\SCOPE\scope_concrete\node_modules\webpack\lib\Compiler.js:506:17)
    at C:\Projects\SCOPE\scope_concrete\node_modules\tapable\lib\Tapable.js:289:11
    at _addModuleChain (C:\Projects\SCOPE\scope_concrete\node_modules\webpack\lib\Compilation.js:507:11)
    at processModuleDependencies.err (C:\Projects\SCOPE\scope_concrete\node_modules\webpack\lib\Compilation.js:477:14)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
 @ ./node_modules/@scope/common/@scope/common.es5.js
 @ ./src/app/app.component.ts
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi ./src/main.ts

How To Reproduce

I’m not sure how. All was done as in ng-packaged repo. Please let me know what provide else.

Version Information

ng-packagr: v1.5.1
node: v8.6.0

Here is my package.json:

{
  "name": "scope-concrete",
  "version": "0.0.0",
  "license": "MIT",
  "angular-cli": {},
  "scripts": {
    "ng": "ng",
    "link:common": "cd common && npm ln && cd .. && npm ln @scope/common",
    "start": "npm run link:common && ng serve",
    "start:dev": "npm run start -- --env=dev",
    "start:local": "npm run start -- --env=local",
    "add:common": "rimraf node_modules/@scope && yarn add file:./dist/common",
    "build": "npm run package && yarn add:common && ng build --prod --aot=false",
    "build:dev": "npm run build -- --env=dev",
    "test": "ng test",
    "pree2e": "webdriver-manager update --standalone false --gecko false",
    "e2e": "protractor",
    "package": "ng-packagr"
  },
  "private": true,
  "dependencies": {
    "@agm/core": "~1.0.0-beta.1",
    "@angular/animations": "^4.4.6",
    "@angular/cdk": "2.0.0-beta.11",
    "@angular/common": "^4.4.6",
    "@angular/compiler": "^4.4.6",
    "@angular/core": "^4.4.6",
    "@angular/flex-layout": "2.0.0-beta.9",
    "@angular/forms": "^4.4.6",
    "@angular/http": "^4.4.6",
    "@angular/material": "2.0.0-beta.11",
    "@angular/platform-browser": "^4.4.6",
    "@angular/platform-browser-dynamic": "^4.4.6",
    "@angular/platform-server": "^4.4.6",
    "@angular/router": "^4.4.6",
    "@floydspace/ngx-validation": "^1.0.3",
    "@ngrx/store": "^4.0.3",
    "@ngrx/store-devtools": "^4.0.0",
    "@types/lodash": "^4.14.77",
    "angular2-text-mask": "^8.0.3",
    "angulartics2": "~3.0.0",
    "bootstrap": "^4.0.0-alpha.6",
    "core-js": "^2.5.0",
    "font-awesome": "^4.7.0",
    "hammerjs": "^2.0.8",
    "lodash": "^4.17.4",
    "md2": "0.0.28",
    "moment": "^2.18.1",
    "mydatepicker": "^2.0.27",
    "ng2-page-scroll": "^4.0.0-beta.11",
    "ngrx-store-localstorage": "^0.2.2",
    "ngx-clipboard": "^8.1.1",
    "ngx-sharebuttons": "^3.0.0",
    "primeng": "^4.1.3",
    "rxjs": "^5.4.2",
    "ts-helpers": "^1.1.1",
    "zone.js": "^0.7.2"
  },
  "devDependencies": {
    "@angular/cli": "^1.5.0",
    "@angular/compiler-cli": "^4.4.6",
    "@types/google.analytics": "0.0.35",
    "@types/jasmine": "2.5.38",
    "@types/node": "^6.0.42",
    "codelyzer": "~2.0.0-beta.1",
    "jasmine-core": "2.5.2",
    "jasmine-spec-reporter": "2.5.0",
    "karma": "1.2.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.0.2",
    "karma-remap-istanbul": "^0.2.1",
    "ng-packagr": "^1.5.1",
    "protractor": "~4.0.13",
    "rimraf": "^2.6.2",
    "ts-node": "1.2.1",
    "tslint": "^4.3.0",
    "typescript": "~2.3.3",
    "webpack": "^3.8.1"
  }
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
floydspacecommented, Nov 10, 2017

The issue was in the angular2-text-mask lib. Not sure why. Perhaps because of it has angular 2 dependencies. Will have to fork it. Anyway, thank you for the great tool.

1reaction
floydspacecommented, Jan 16, 2018

@sshraki I mean ng-packagr is a great tool. To resolve the issue you should add all your external dependencies to lib.externals in ng-package.json. Check each of them in your package.json one by one to determine which one causes the issue. hope it helps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found