nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.86k stars 2.38k forks source link

Cannot read property 'toString' of undefined #1367

Closed nileshkorpad1 closed 5 years ago

nileshkorpad1 commented 5 years ago

I am getting an error like Cannot read property 'toString' of undefined Following is my package.json files

  1. Angular material src fetched from https://github.com/angular/material
  2. Angular CDK latest Version
  3. Typescript: 3.2.4
  4. @nrwl/schematics: 7.8.6
  5. @nrwl/builders: 7.8.6
  6. @nrwl/nx: 7.8.6

Following is my error log

[ Cannot read property 'toString' of undefined TypeError: Cannot read property 'toString' of undefined at new Input (/Users/Rapunzel/Sites/beta/KIDA/node_modules/postcss/lib/input.js:53:20) at parse (/Users/Rapunzel/Sites/beta/KIDA/node_modules/postcss/lib/parse.js:13:15) at new LazyResult (/Users/Rapunzel/Sites/beta/KIDA/node_modules/postcss/lib/lazy-result.js:60:16) at Processor. (/Users/Rapunzel/Sites/beta/KIDA/node_modules/postcss/lib/processor.js:138:12) at Processor.process (/Users/Rapunzel/Sites/beta/KIDA/node_modules/postcss/lib/processor.js:117:23) at StylesheetProcessor.process (/Users/Rapunzel/Sites/beta/KIDA/node_modules/ng-packagr/lib/ng-v5/entry-point/resources/stylesheet-processor.js:42:46) at Object.readResource (/Users/Rapunzel/Sites/beta/KIDA/node_modules/ng-packagr/lib/ts/cache-compiler-host.js:73:57) at TsCompilerAotCompilerTypeCheckHostAdapter.loadResource (/Users/Rapunzel/Sites/beta/KIDA/node_modules/@angular/compiler-cli/src/transformers/compiler_host.js:470:37) at Object.get (/Users/Rapunzel/Sites/beta/KIDA/node_modules/@angular/compiler/bundles/compiler.umd.js:25590:94) at DirectiveNormalizer._fetch (/Users/Rapunzel/Sites/beta/KIDA/node_modules/@angular/compiler/bundles/compiler.umd.js:16229:47) at /Users/Rapunzel/Sites/beta/KIDA/node_modules/@angular/compiler/bundles/compiler.umd.js:16351:72 at Array.map () at DirectiveNormalizer._loadMissingExternalStylesheets (/Users/Rapunzel/Sites/beta/KIDA/node_modules/@angular/compiler/bundles/compiler.umd.js:16351:18) at DirectiveNormalizer._normalizeTemplateMetadata (/Users/Rapunzel/Sites/beta/KIDA/node_modules/@angular/compiler/bundles/compiler.umd.js:16299:40) at /Users/Rapunzel/Sites/beta/KIDA/node_modules/@angular/compiler/bundles/compiler.umd.js:16256:116

]

vsavkin commented 5 years ago

@nileshkorpad1 could you provide a github repo with aa repro?

nileshkorpad1 commented 5 years ago

@vsavkin , I can not share you whole repo but I can share you my package.json file Also please use angular material src file and create the library and add src folder to library

My package.json file is

{ "name": "TandemUI", "version": "0.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "package:framework": "ng build framework && rm -rf node_modules/@wtf2 && cp -r libs/fuse node_modules/@wtf2/", "package:web-chat": "ng build web-chat --prod --output-hashing=none && cat ./dist/apps/web-components/web-chat/runtime.js ./dist/apps/web-components/web-chat/polyfills.js ./dist/apps/web-components/web-chat/scripts.js ./dist/apps/web-components/web-chat/main.js > ./dist/apps/web-components/web-chat/index.js && cp apps/web-components/web-chat/package.json dist/apps/web-components/web-chat/package.json && cp apps/web-components/web-chat/README.md dist/apps/web-components/web-chat/README.md", "test": "ng test", "lint": "./node_modules/.bin/nx lint && ng lint", "e2e": "ng e2e", "affected:apps": "./node_modules/.bin/nx affected:apps", "affected:build": "./node_modules/.bin/nx affected:build", "affected:e2e": "./node_modules/.bin/nx affected:e2e", "format": "./node_modules/.bin/nx format:write", "format:write": "./node_modules/.bin/nx format:write", "format:check": "./node_modules/.bin/nx format:check", "update": "ng update @nrwl/schematics", "update:check": "ng update:check @nrwl/schematics", "update:skip": "ng update:skip @nrwl/schematics", "workspace-schematic": "./node_modules/.bin/nx workspace-schematic", "prettier": "prettier --write \"{apps,libs}/*/.ts\"", "prettier:warn": "prettier -l \"{apps,libs}/*/.ts\"", "pwa": "ng build --prod && http-server ./dist/apps/fullswing -p 8080", "cypress:open": "cypress open", "cypress:record": "cypress run --record --key 6e972026-4e59-4057-b742-62b827823af6 --browser chrome --config pageLoadTimeout=10000", "cypress:record:ci": "cypress run --key 6e972026-4e59-4057-b742-62b827823af6 --record --browser chrome --config pageLoadTimeout=10000", "dep-graph": "./node_modules/.bin/nx dep-graph", "affected:dep-graph": "./node_modules/.bin/nx affected:dep-graph", "help": "./node_modules/.bin/nx help", "serve:storybook": "start-storybook -p 9001 -c .storybook", "build:storybook": "build-storybook -c .storybook -o ./dist/storybook", "deploy:storybook": "npm run build:storybook && netlify deploy --dir=./dist/storybook --prod", "deploy:vallum": "ng build demos-vallum --prod && netlify deploy --dir=./dist/apps/demos/vallum --prod --site=408cb039-de4f-41f8-a4f2-45dd47e225fd", "affected:test": "./node_modules/.bin/nx affected:test" }, "private": true, "dependencies": { "@angular/animations": "^7.2.13", "@angular/common": "^7.2.13", "@angular/compiler": "^7.2.13", "@angular/core": "^7.2.13", "@angular/forms": "^7.2.13", "@angular/platform-browser": "^7.2.13", "@angular/platform-browser-dynamic": "^7.2.13", "@angular/router": "^7.2.13", "core-js": "^2.6.5", "rxjs": "6.0.0", "zone.js": "^0.8.29", "@agm/core": "^1.0.0-beta.5", "@angular/cdk": "^7.3.7", "@angular/elements": "^7.2.13", "@angular/flex-layout": "7.0.0-beta.23", "@angular/http": "^7.2.13", "@angular/material": "^7.3.7", "@angular/material-moment-adapter": "^7.3.7", "@angular/service-worker": "^7.2.13", "@ngrx/effects": "^7.4.0", "@ngrx/entity": "^7.4.0", "@ngrx/router-store": "^7.4.0", "@ngrx/store": "^7.4.0", "@ngrx/store-devtools": "^7.4.0", "@ngx-translate/core": "^11.0.1", "@nrwl/nx": "^7.8.1", "@swimlane/dragula": "^3.8.0", "@swimlane/ngx-charts": "^10.1.0", "@swimlane/ngx-datatable": "^14.0.0", "@swimlane/ngx-dnd": "^6.0.0", "@types/prismjs": "^1.16.0", "@webcomponents/custom-elements": "^1.2.4", "angular-calendar": "^0.26.11", "angular-in-memory-web-api": "^0.8.0", "angularfire2": "^5.1.2", "auth0-js": "^9.10.2", "chart.js": "^2.8.0", "classlist.js": "^1.1.20150312", "d3": "^5.9.2", "date-fns": "^1.30.1", "document-register-element": "^1.13.2", "firebase": "^5.10.0", "firebase-admin": "^7.3.0", "firebase-functions": "^2.3.0", "hammerjs": "^2.0.8", "lodash": "^4.17.11", "material-icons": "^0.3.1", "moment": "^2.24.0", "ng2-charts": "^1.6.0", "ngrx-store-freeze": "^0.2.4", "ngx-color-picker": "^7.5.0", "ngx-cookie-service": "^2.1.0", "perfect-scrollbar": "^1.4.0", "prismjs": "^1.16.0", "ramda": "^0.26.1", "rxjs-compat": "6.0.0", "web-animations-js": "^2.3.1" }, "devDependencies": { "jest-preset-angular": "^6.0.2", "@angular/compiler-cli": "^7.2.13", "@angular/language-service": "^7.2.13", "@angular-devkit/build-angular": "^0.13.8", "codelyzer": "^4.5.0", "@angular-devkit/build-ng-packagr": "^0.13.8", "@angular/cli": "^7.3.8", "@angularclass/hmr": "^2.1.3", "@babel/core": "^7.4.3", "@bahmutov/add-typescript-to-cypress": "^2.0.0", "@ngrx/schematics": "^7.4.0", "@nrwl/builders": "^7.8.1", "@nrwl/schematics": "^7.8.1", "@storybook/addon-actions": "^5.0.10", "@storybook/addon-knobs": "^5.0.10", "@storybook/addon-storysource": "^5.0.10", "@storybook/addon-viewport": "^5.0.10", "@storybook/angular": "^5.0.10", "@types/auth0-js": "^8.11.12", "@types/chai": "^4.1.7", "@types/chai-jquery": "^1.1.38", "@types/cypress": "^1.1.3", "@types/jasmine": "^2.8.16", "@types/jasminewd2": "^2.0.6", "@types/jest": "^24.0.11", "@types/lodash": "^4.14.123", "@types/node": "^8.10.46", "babel-loader": "^8.0.5", "cypress": "^3.2.0", "husky": "^1.3.1", "jasmine-core": "^2.99.1", "jasmine-marbles": "^0.4.1", "jasmine-spec-reporter": "^4.2.1", "jest": "^24.7.1", "karma": "^3.1.4", "karma-chrome-launcher": "^2.2.0", "karma-coverage-istanbul-reporter": "^2.0.5", "karma-jasmine": "^1.1.2", "karma-jasmine-html-reporter": "^0.2.2", "ng-packagr": "^4.7.1", "prettier": "^1.17.0", "protractor": "^5.4.2", "ts-node": "^7.0.1", "tsickle": "^0.34.3", "tslib": "^1.9.3", "tslint": "^5.16.0", "typescript": "3.2.2", "webpack-bundle-analyzer": "^3.3.2" } }

vsavkin commented 5 years ago

Unfortunately the error is too generic to be able to troubleshoot without a repo reproducing it. I'm closing this issue. I'm sorry about it.

eugenotop commented 5 years ago

$ ng g @nrwl/angular:application client ? In which directory should the application be generated? ? Which stylesheet format would you like to use? SASS(.scss) [ http://sass-lang.com ] ? Would you like to configure routing for this application? Yes ? Which tags would you like to add to the application? (used for linting) Cannot read property 'toString' of null

dbigintonpro commented 5 years ago

Unfortunately the error is too generic to be able to troubleshoot without a repo reproducing it. I'm closing this issue. I'm sorry about it.

I have had a similar experience, using Angular CLI v8 and NX v8. It turns out the issue is related to @angular/pwa. To test, removing the @angular/pwa temporarily, then performing the app generation, and finally reinstalling @angular/pwa solved the issue for me.

npm uninstall @angular/pwa ng g @nrwl/angular:application vision npm install @angular/pwa

Nrwl - is there anyway to resolve this issue in the schematics?

nileshkorpad1 commented 5 years ago

Thanks I resolved it

On Thu, Jul 25, 2019 at 10:36 PM Daniel Biginton notifications@github.com wrote:

Unfortunately the error is too generic to be able to troubleshoot without a repo reproducing it. I'm closing this issue. I'm sorry about it.

I have had a similar experience, using Angular CLI v8 and NX v8. It turns out the issue is related to @angular/pwa. To test, removing the @angular/pwa temporarily, then performing the app generation, and finally reinstalling @angular/pwa solved the issue for me.

npm uninstall @angular/pwa ng g @nrwl/angular:application vision npm install @angular/pwa

Nrwl - is there anyway to resolve this issue in the schematics?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nrwl/nx/issues/1367?email_source=notifications&email_token=ABOWUUL65P2PECBLZLZF4XTQBG26JA5CNFSM4HOSJF72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2ZVORY#issuecomment-515069767, or mute the thread https://github.com/notifications/unsubscribe-auth/ABOWUUI5OLU6RNNTY5IUQU3QBG26JANCNFSM4HOSJF7Q .

eLarocque commented 4 years ago

Thanks I resolved it On Thu, Jul 25, 2019 at 10:36 PM Daniel Biginton @.***> wrote: Unfortunately the error is too generic to be able to troubleshoot without a repo reproducing it. I'm closing this issue. I'm sorry about it. I have had a similar experience, using Angular CLI v8 and NX v8. It turns out the issue is related to @angular/pwa. To test, removing the @angular/pwa temporarily, then performing the app generation, and finally reinstalling @angular/pwa solved the issue for me. npm uninstall @angular/pwa ng g @nrwl/angular:application vision npm install @angular/pwa Nrwl - is there anyway to resolve this issue in the schematics? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#1367?email_source=notifications&email_token=ABOWUUL65P2PECBLZLZF4XTQBG26JA5CNFSM4HOSJF72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2ZVORY#issuecomment-515069767>, or mute the thread https://github.com/notifications/unsubscribe-auth/ABOWUUI5OLU6RNNTY5IUQU3QBG26JANCNFSM4HOSJF7Q .

Did you resolve it by looking at @angular/pwa or by other means?

riapacheco commented 3 years ago

Had the same problem and uninstalling @angular/pwa did the trick.

github-actions[bot] commented 1 year ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.