samples-js-angular icon indicating copy to clipboard operation
samples-js-angular copied to clipboard

testenv issue

Open Fusekki opened this issue 5 years ago • 5 comments

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.

Fusekki avatar Jul 23 '20 14:07 Fusekki

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.

mrgrape avatar Jul 28 '20 17:07 mrgrape

@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 avatar Jul 28 '20 17:07 swiftone

Internal ref: OKTA-317699

swiftone avatar Aug 03 '20 21:08 swiftone

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.

a-titorenko avatar Jul 16 '21 12:07 a-titorenko

@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?