angular / material.angular.io

Docs site for Angular Components
http://material.angular.io
MIT License
881 stars 392 forks source link

Build error in "@angular/material-examples": "angular/material2-docs-content#8.1.x" #629

Closed jpelton-stroud closed 4 years ago

jpelton-stroud commented 4 years ago

Am I doing it wrong?

Build fails with ERROR in Unexpected value 'undefined' imported by the module 'ExampleModule in /home/jpstroud/material.angular.io/node_modules/@angular/material-examples/examples_public_index.d.ts' after fresh clone when following the Development Setup Guide.

FWIW, I'm running this on a Pixelbook; I haven't yet had any problems w/ running my own project code, but this is my first time w/ yarn, specifically.

yarn start output:

jpstroud@penguin:~/material.angular.io$ yarn start
yarn run v1.17.3
$ npm run build-themes && ng serve
npm WARN lifecycle The node binary used for scripts is /tmp/yarn--1567474129192-0.9321436184585852/node but npm is using /home/jpstroud/.config/versions/node/v10.16.3/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> material-angular-io@0.0.0 build-themes /home/jpstroud/material.angular.io
> bash ./tools/build-themes.sh

Building custom theme scss files.
Finished building CSS.

Date: 2019-09-03T01:29:14.626Z
Hash: 88b1f4ac0557d0f54580
Time: 16068ms
chunk {deeppurple-amber} deeppurple-amber.js, deeppurple-amber.js.map (deeppurple-amber) 181 kB [initial] [rendered]
chunk {indigo-pink} indigo-pink.js, indigo-pink.js.map (indigo-pink) 180 kB [initial] [rendered]
chunk {main} main.js, main.js.map (main) 1.9 kB [initial] [rendered]
chunk {pink-bluegrey} pink-bluegrey.js, pink-bluegrey.js.map (pink-bluegrey) 186 kB [initial] [rendered]
chunk {polyfills-es5} polyfills-es5.js, polyfills-es5.js.map (polyfills-es5) 435 kB [initial] [rendered]
chunk {purple-green} purple-green.js, purple-green.js.map (purple-green) 186 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.08 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 467 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 327 kB [initial] [rendered]

ERROR in Unexpected value 'undefined' imported by the module 'ExampleModule in /home/jpstroud/material.angular.io/node_modules/@angular/material-examples/examples_public_index.d.ts'

** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
ℹ 「wdm」: Failed to compile.

ng --version output:

Angular CLI: 8.2.1
Node: 10.16.3
OS: linux x64
Angular: 8.2.2
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.800.6
@angular-devkit/build-angular      0.800.6
@angular-devkit/build-optimizer    0.800.6
@angular-devkit/build-webpack      0.800.6
@angular-devkit/core               8.2.1
@angular-devkit/schematics         8.2.1
@angular/cdk                       8.1.4
@angular/cdk-experimental          8.1.3
@angular/cli                       8.2.1
@angular/material                  8.1.4
@angular/material-examples         8.1.4-4eec07d
@angular/material-experimental     8.1.3
@angular/material-moment-adapter   8.1.4
@ngtools/webpack                   8.0.6
@schematics/angular                8.2.1
@schematics/update                 0.802.1
rxjs                               6.5.2
typescript                         3.4.5
webpack                            4.30.0

yarn e2e output:

jpstroud@penguin:~/material.angular.io$ yarn e2e
yarn run v1.17.3
$ webdriver-manager update
[21:21:03] I/config_source - curl -o/home/jpstroud/material.angular.io/node_modules/webdriver-manager/selenium/gecko-response.json https://api.github.com/repos/mozilla/geckodriver/releases
[21:21:03] I/update - chromedriver: file exists /home/jpstroud/material.angular.io/node_modules/webdriver-manager/selenium/chromedriver_76.0.3809.12.zip
[21:21:03] I/update - chromedriver: unzipping chromedriver_76.0.3809.12.zip
[21:21:03] I/update - chromedriver: setting permissions to 0755 for /home/jpstroud/material.angular.io/node_modules/webdriver-manager/selenium/chromedriver_76.0.3809.12
[21:21:03] I/update - chromedriver: chromedriver_76.0.3809.12 up to date
[21:21:03] I/update - selenium standalone: file exists /home/jpstroud/material.angular.io/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.141.59.jar
[21:21:03] I/update - selenium standalone: selenium-server-standalone-3.141.59.jar up to date
[21:21:04] I/downloader - curl -o/home/jpstroud/material.angular.io/node_modules/webdriver-manager/selenium/geckodriver-v0.24.0.tar.gz https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz
[21:21:04] I/update - geckodriver: unzipping geckodriver-v0.24.0.tar.gz
[21:21:05] I/update - geckodriver: setting permissions to 0755 for /home/jpstroud/material.angular.io/node_modules/webdriver-manager/selenium/geckodriver-v0.24.0
$ protractor
(node:10384) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.

/home/jpstroud/material.angular.io/node_modules/ts-node/src/index.ts:253
    return new TSError(diagnosticText, diagnosticCodes)
           ^
TSError: ⨯ Unable to compile TypeScript:
error TS5058: The specified path does not exist: '/home/jpstroud/material.angular.io/e2e'.    at createTSError (/home/jpstroud/material.angular.io/node_modules/ts-node/src/index.ts:253:12)
    at Object.register (/home/jpstroud/material.angular.io/node_modules/ts-node/src/index.ts:257:42)
    at beforeLaunch (/home/jpstroud/material.angular.io/protractor.conf.js:24:24)
    at q_1.Promise (/home/jpstroud/material.angular.io/node_modules/protractor/built/util.js:46:49)
    at Function.promise (/home/jpstroud/material.angular.io/node_modules/q/q.js:682:9)
    at Object.runFilenameOrFn_ (/home/jpstroud/material.angular.io/node_modules/protractor/built/util.js:38:16)
    at Object.initFn [as init] (/home/jpstroud/material.angular.io/node_modules/protractor/built/launcher.js:104:12)
    at Object.<anonymous> (/home/jpstroud/material.angular.io/node_modules/protractor/built/cli.js:225:10)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
billsedison commented 4 years ago

Met the same issue.

billsedison commented 4 years ago

A quick temporary workaround: downgrade "@angular/material-examples": "angular/material2-docs-content#8.1.x" to "@angular/material-examples": "angular/material2-docs-content#8.0.x" in package.json.

So looks there are some issues in "angular/material2-docs-content#8.1.x"

jpelton-stroud commented 4 years ago

So looks there are some issues in "angular/material2-docs-content#8.1.x"

Manually setting back to 8.0.x and reinstalling did, in fact, get the install running.

marckassay commented 4 years ago

Update: I advise against attempting this hack. I'm using yarn and Docker, and having problems with it still. But I did test this on a vanilla Angular project having 'angular/material-example' as a dependency and it works.

Here is a temporary hack. Replace the current @angular/material-examples dependency in package.json, with this:

"@angular/material-examples": "https://codeload.github.com/angular/material2-docs-content/tar.gz/7b223fbc784d9812f9c7ef523e5332cf5ba91d5d"

Using yarn, the lock file will read this after being installed for @angular/material-examples:

"@angular/material-examples@https://codeload.github.com/angular/material2-docs-content/tar.gz/7b223fbc784d9812f9c7ef523e5332cf5ba91d5d":
  version "8.1.4-4eec07d"
  resolved "https://codeload.github.com/angular/material2-docs-content/tar.gz/7b223fbc784d9812f9c7ef523e5332cf5ba91d5d#3f1c4bac4cb7b62097f8665ecbce9e5230913ce1"
  dependencies:
    tslib "^1.7.1"

The current value in package.json, for @angular/material-examples is: angular/material2-docs-content#8.1.x. This is a GitHub url that gets resolved to something similar to what I have above. What I have above is the latest resolved value for 8.1.x branch. It seems that perhaps the service that does the mapping has not worked in about 20 days. This was the last commit that seems to not have this issue.

Splaktar commented 4 years ago

I believe that this has been resolved as I cannot reproduce it today. Please confirm so that we can close this or provide additional reproduction steps for investigation.

jpelton-stroud commented 4 years ago

we're doing it live! From a fresh wipe/install of the VM (i'm on a chromebook pixel):

  1. nvm install via script
  2. restart Termina, command -v nvm confirms successful install;
  3. nvm install --lts -> Now using node v10.16.3 (npm v6.9.0)
  4. install yarn with the --no-install-recommends flag for nvm users;
  5. git clone https://github.com/angular/material.angular.io.git && cd to folder
  6. yarn install now, if I stop here and run yarn start, the local dev server builds and compiles w/o issue, and http://localhost:4200/ goes straight to the main page. However, the install guide says...

Update to the latest version of the docs-content and examples

So I stop the dev server and yarn upgrade @angular/material-examples:

yarn upgrade v1.17.3
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.9: The platform "linux" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > @angular/cdk-experimental@8.1.3" has incorrect peer dependency "@angular/cdk@8.1.3".
warning " > @angular/material-experimental@8.1.3" has incorrect peer dependency "@angular/material@8.1.3".
warning " > @angular/material-experimental@8.1.3" has incorrect peer dependency "material components-web@^3.0.0".
warning " > @angular/material-examples@8.1.4-4eec07d" has incorrect peer dependency "@angular/cdk@8.1.4-4eec07d".
warning " > @angular/material-examples@8.1.4-4eec07d" has incorrect peer dependency "@angular/cdk-experimental@8.1.4-4eec07d".
warning " > @angular/material-examples@8.1.4-4eec07d" has incorrect peer dependency "@angular/material@8.1.4-4eec07d".
warning " > @angular/material-examples@8.1.4-4eec07d" has incorrect peer dependency "@angular/material-experimental@8.1.4-4eec07d".
warning " > @angular/material-examples@8.1.4-4eec07d" has incorrect peer dependency "@angular/material-moment-adapter@8.1.4-4eec07d".
[4/4] Rebuilding all packages...
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
└─ @angular/material-examples@8.1.4-4eec07d
info All dependencies
└─ @angular/material-examples@8.1.4-4eec07d
Done in 14.40s.

and now yarn start results in:

ERROR in Unexpected value 'undefined' imported by the module 'ExampleModule in /home/jpstroud/material.angular.io/node_modules/@angular/material examples/examples_public_index.d.ts'

** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
ℹ 「wdm」: Failed to compile.

So yeah...no luck (unless I really am doing something wrong...).

Splaktar commented 4 years ago
ERROR in Unexpected value 'undefined' imported by the module 'ExampleModule in /home/jpstroud/material.angular.io/node_modules/@angular/material examples/examples_public_index.d.ts'

This is a new error that I just hit as well due to some recent merges.

Hopefully PR https://github.com/angular/material.angular.io/pull/640 will help resolve this.

Splaktar commented 4 years ago

Well PR #640 ran into https://github.com/angular/components/issues/17264.

PR #641 should fix this temporarily.