okta / samples-js-angular

samples-js-angular
https://github.com/okta/samples-js-angular
Other
73 stars 149 forks source link

testenv issue #82

Open Fusekki opened 4 years ago

Fusekki commented 4 years ago

I am following the documentation and have created a testenv file in the same directory as the README file. I've tried pasting in our correct values, but I get the error below. Finally, I just copied the code from the README and pasted into:

ISSUER=https://yourOktaDomain.com/oauth2/default
CLIENT_ID=123xxxxx123
USERNAME=testuser
PASSWORD=testpass

Yet I get this error after running ng serve:

An unhandled exception occurred: Environment variable ISSUER must be set. See README.md

Not sure what I am doing wrong.

mrgrape commented 4 years ago

I fixed the issue this way:

Check the extra-webpack.config.js file.

const TESTENV = path.resolve(__dirname, "..", "testenv");

You can console.log(TESTENV); then run ng serve and it'll print the file path in the console.

Make sure the testenv file path is correct and it should start working. Changing the value ".." to "." worked for me.

swiftone commented 4 years ago

@staffordp - thanks for the report. Unfortunately, the testenv file isn't yet supported for this sample. See https://github.com/okta/samples-js-angular#running-the-tests - you'll have to export the values as environment variables, or do a work-around like @mrgrape suggests.

swiftone commented 4 years ago

Internal ref: OKTA-317699

a-titorenko commented 3 years ago

Hello guys!

Cannot run custom login page example. Got error on Mac:

$ ng serve Compiling @angular/core : es2015 as esm2015 Error: Error on worker #1: TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator)) at read (/Users/kit/Plays/samples-js-angular/custom-login/node_modules/tslib/tslib.js:174:50) at Object.__spread (/Users/kit/Plays/samples-js-angular/custom-login/node_modules/tslib/tslib.js:193:28) at Renderer.renderAdjacentStatements (/Users/kit/Plays/samples-js-angular/custom-login/node_modules/@angular/compiler-cli/ngcc/src/rendering/renderer.js:159:63) at /Users/kit/Plays/samples-js-angular/custom-login/node_modules/@angular/compiler-cli/ngcc/src/rendering/renderer.js:80:52 at Array.forEach () at Renderer.renderFile (/Users/kit/Plays/samples-js-angular/custom-login/node_modules/@angular/compiler-cli/ngcc/src/rendering/renderer.js:76:46) at /Users/kit/Plays/samples-js-angular/custom-login/node_modules/@angular/compiler-cli/ngcc/src/rendering/renderer.js:53:84 at Array.forEach () at Renderer.renderProgram (/Users/kit/Plays/samples-js-angular/custom-login/node_modules/@angular/compiler-cli/ngcc/src/rendering/renderer.js:48:54) at Transformer.transform (/Users/kit/Plays/samples-js-angular/custom-login/node_modules/@angular/compiler-cli/ngcc/src/packages/transformer.js:84:42) at ClusterMaster.onWorkerMessage (/Users/kit/Plays/samples-js-angular/custom-login/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:195:27) at /Users/kit/Plays/samples-js-angular/custom-login/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:55:95 at ClusterMaster. (/Users/kit/Plays/samples-js-angular/custom-login/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:293:57) at step (/Users/kit/Plays/samples-js-angular/custom-login/node_modules/tslib/tslib.js:143:27) at Object.next (/Users/kit/Plays/samples-js-angular/custom-login/node_modules/tslib/tslib.js:124:57) at /Users/kit/Plays/samples-js-angular/custom-login/node_modules/tslib/tslib.js:117:75 at new Promise () at Object.awaiter (/Users/kit/Plays/samples-js-angular/custom-login/node_modules/tslib/tslib.js:113:16) at EventEmitter. (/Users/kit/Plays/samples-js-angular/custom-login/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:287:32) at EventEmitter.emit (events.js:314:20) An unhandled exception occurred: NGCC failed. See "/private/var/folders/jg/0gcvv8pd7c79_wdh7580bsy80000gn/T/ng-4IUd2B/angular-errors.log" for further details.

oleksandrpravosudko-okta commented 3 years ago

@a-titorenko this does not seem to be related to the SDK code - does clearing node_modules resolve this? Which Angular version you are using?