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.

Cannot read property 'module' of undefined

See original GitHub issue

Type of Issue

[ ] Bug Report
[ ] Feature Request

Description

I can not found what is cause of my problem BUILD ERROR

Cannot read property 'module' of undefined
TypeError: Cannot read property 'module' of undefined
    at MetadataBundler.convertSymbol (C:\Users\azizkhani\git\ng-baharan\node_modules\@angular\compiler-cli\src\metadata\bundler.js:312:61)
    at createReference (C:\Users\azizkhani\git\ng-baharan\node_modules\@angular\compiler-cli\src\metadata\bundler.js:438:27)
    at MetadataBundler.convertReference (C:\Users\azizkhani\git\ng-baharan\node_modules\@angular\compiler-cli\src\metadata\bundler.js:486:28)
    at MetadataBundler.convertExpression (C:\Users\azizkhani\git\ng-baharan\node_modules\@angular\compiler-cli\src\metadata\bundler.js:415:37)
    at MetadataBundler.convertValue (C:\Users\azizkhani\git\ng-baharan\node_modules\@angular\compiler-cli\src\metadata\bundler.js:396:29)
    at C:\Users\azizkhani\git\ng-baharan\node_modules\@angular\compiler-cli\src\metadata\bundler.js:399:62
    at Array.map (<anonymous>)
    at MetadataBundler.convertValue (C:\Users\azizkhani\git\ng-baharan\node_modules\@angular\compiler-cli\src\metadata\bundler.js:399:30)
    at MetadataBundler.convertValue (C:\Users\azizkhani\git\ng-baharan\node_modules\@angular\compiler-cli\src\metadata\bundler.js:405:36)
    at C:\Users\azizkhani\git\ng-baharan\node_modules\@angular\compiler-cli\src\metadata\bundler.js:399:62

Version Information

"@angular-devkit/build-angular": "~0.11.0",
    "@angular/cli": "~7.1.3",
    "@angular/compiler-cli": "~7.1.0",
    "@angular/language-service": "~7.1.0",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/jquery": "^3.3.29",
    "@types/node": "~8.9.4",
    "@types/socket.io": "^2.1.2",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~3.1.1",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "ng-packagr": "^4.4.5",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tsickle": "^0.34.0",
    "tslint": "~5.11.0",
    "typescript": "~3.1.6"

Please include all version numbers that might be relevant, e.g. third-party libraries this is my library https://github.com/azizkhani/ng-library

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

14reactions
azizkhanicommented, Dec 31, 2018

Why project run and build correctly with angular but ng-packagr can not build that. How can i found ,which part of my configuration make this exception? Error is very general and dose not show which module have problem

13reactions
jmorenovaldecommented, May 16, 2019

I had the same problem. The problem is that ng-packer didn’t work well with barrel routes.

For example:

import { ElementService } from 'path_barrel';

If you change the barrel for the real path work well.

import { ElementService } from 'path_element/element.service';
Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'module' of undefined while building ...
I generated angular lib project and slowly moving the modules. I now get the following error while building the library. ng build lib....
Read more >
TypeError: Cannot read property 'module' of undefined - ionic-v3
Hi, I'm new to ionic, trying to write a simple authentication app. I received “Cannot read property 'module' of undefined” as a runtime...
Read more >
Uncaught TypeError: Cannot read property 'module'
Hi, I'm trying the automated test framework on my dev instance (istanbul release) and setting up a very simple test. 1. Impersonate user...
Read more >
How to Avoid the Infamous "Cannot read properties of ... - Bitovi
That error message is telling you the function is returning undefined implicitly, but its return type does not include undefined in it. Awesome!...
Read more >
cannot read properties of undefined (reading 'module')
Your issue is that your .find() method is returning undefined , so you can't access properties on product such as .name as it...
Read more >

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