ng-dynamic-component icon indicating copy to clipboard operation
ng-dynamic-component copied to clipboard

no-barrels tag not working: ERROR in Unexpected value 'undefined' imported by the module 'DynamicModule

Open KissBalazs opened this issue 4 years ago • 5 comments

I experience the problem described in the pinned issue: https://github.com/gund/ng-dynamic-component/issues/369

After following the guide, and changing the dependency from "ng-dynamic-component": "^6.1.0", to "ng-dynamic-component": "^8.0.1-no-barrels.1", I still encounter the said problem.

Error message upon ng serve:

ERROR in Unexpected value 'undefined' imported by the module 'DynamicModule in /....../node_modules/ng-dynamic-component/ng-dynamic-component.d.ts'

node_modules/ng-dynamic-component/package.json:

{
  "_from": "ng-dynamic-component@^8.0.1-no-barrels.1",
  "_id": "[email protected]",
  "_inBundle": false,
  "_integrity": "sha512-Ak25QTYmjNVxyZ6ywqRDDjoqAJheFeK0XoHsomwVjdHSiLoQcGfNNj5z51pqoRGpjdDZMSV+J2gaCbRNBeiy3g==",
  "_location": "/ng-dynamic-component",
  "_phantomChildren": {},
  "_requested": {
    "type": "range",
    "registry": true,
    "raw": "ng-dynamic-component@^8.0.1-no-barrels.1",
    "name": "ng-dynamic-component",
    "escapedName": "ng-dynamic-component",
    "rawSpec": "^8.0.1-no-barrels.1",
    "saveSpec": null,
    "fetchSpec": "^8.0.1-no-barrels.1"
  },
  ...

KissBalazs avatar Jan 25 '21 13:01 KissBalazs

+1 for this persisting issue. I thought it might be due to npm cache, so after a clean npm install with "ng-dynamic-component": "^8.0.1-no-barrels.1", I now get:

Error: Error: Internal error: unknown identifier undefined
    at Object.importExpr$1 [as importExpr] (<project-dir>\node_modules\@angular\compiler\bundles\compiler.umd.js:28399:27)
    at tokenExpr (<project-dir>\node_modules\@angular\compiler\bundles\compiler.umd.js:25025:43)
    at providerDef (<project-dir>\node_modules\@angular\compiler\bundles\compiler.umd.js:24951:24)

ardentia avatar Mar 12 '21 15:03 ardentia

+1 same error upgrading from "ng-dynamic-component": "6.1.1-no-barrels.2"

samuil4 avatar Mar 12 '21 16:03 samuil4

This is super strange.

Could it be because you are upgrading from older version of Angular as well?

If so I would recommend trying to delete package lock file (either package-lock.json or yarn.lock) and trying to install again.

gund avatar Mar 12 '21 17:03 gund

I am using Angular 11, updated from Angular 8. Deleted node_modules and package-lock.json, cleared the npm cache, reinstalled everything and got the "unknown identifier undefined" error. These are my dependencies:

 "dependencies": {
    "@angular-slider/ngx-slider": "^2.0.3",
    "@angular/animations": "~11.2.5",
    "@angular/common": "~11.2.5",
    "@angular/compiler": "~11.2.5",
    "@angular/core": "~11.2.5",
    "@angular/forms": "~11.2.5",
    "@angular/platform-browser": "~11.2.5",
    "@angular/platform-browser-dynamic": "~11.2.5",
    "@angular/router": "~11.2.5",
    "core-js": "^2.5.4",
    "hammerjs": "^2.0.8",
    "is-docker": "2.0.0",
    "moment-mini": "^2.22.1",
    "ng-dynamic-component": "^8.0.1-no-barrels.1",
    "ngx-bootstrap": "^6.2.0",
    "rxjs": "~6.5.2",
    "tar": "^4.4.10",
    "tslib": "^2.0.0",
    "yfiles": "^2.1.0",
    "zone.js": "~0.10.2"
  }

ardentia avatar Mar 13 '21 16:03 ardentia

Hi there,

Facing the same issues with Angular 11.0.9

Unexpected value 'undefined' imported by the module 'DynamicModule in ../node_modules/ng-dynamic-component/ng-dynamic-component.d.ts'

Deleted package-lock.json & deleted node_modules and re-installed. No luck!

rrekapalli avatar Apr 30 '21 16:04 rrekapalli

This should no longer be an issue with latest Angular and Ivy builds. I'm closing this issue as it's outdated. If you want to reopen the discussion please feel free to open a new issue.

gund avatar Aug 28 '22 01:08 gund