Hi,
I am rather new to okta as a developer.
I just figured out how to get the flutter web to integrate with the okta JavaScript login.
Now, I am trying to figure out two important things.
- The instructions for handling the Javascript Web embedded self-service user registration says to create a okta app with type “web”. The working version for my flutter login requires SPA type. I am wondering if these are cross compatible.
2.) I am trying fo better understand how to build the self-service user registration by looking at the sample source code okta-auth-js/samples/generated/express-embedded-auth-with-sdk at master · okta/okta-auth-js · GitHub. However, I cannot get it to build or run correctly.
From the instructions in the sample README.md, I should start the sample fro the specific sample directory. And I need to run it like:
yarn workspace {generatedSamplePkgName} start
When I do that, I get this error:
(base) seankang@Sean-Kang express-embedded-auth-with-sdk % yarn workspace @okta/samples.express-embedded-auth-with-sdk start
yarn workspace v1.22.22
yarn run v1.22.22
$ node ./web-server/server.js
node:internal/modules/cjs/loader:598
throw e;
^
Error: Cannot find module ‘/Users/seankang/git/javascript/okta/okta-auth-js/node_modules/@okta/okta-auth-js/build/cjs/exports/default.js’
at createEsmNotFoundErr (node:internal/modules/cjs/loader:1181:15)
at finalizeEsmResolution (node:internal/modules/cjs/loader:1169:15)
at resolveExports (node:internal/modules/cjs/loader:591:14)
at Module._findPath (node:internal/modules/cjs/loader:668:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1130:27)
at Module._load (node:internal/modules/cjs/loader:985:27)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at Object. (/Users/seankang/git/javascript/okta/okta-auth-js/samples/generated/express-embedded-auth-with-sdk/web-server/utils/getAuthClient.js:14:18)
at Module._compile (node:internal/modules/cjs/loader:1376:14) {
code: ‘MODULE_NOT_FOUND’,
path: ‘/Users/seankang/git/javascript/okta/okta-auth-js/node_modules/@okta/okta-auth-js/package.json’
}
Node.js v20.10.0
error Command failed with exit code 1.
info Visit yarn run | Yarn for documentation about this command.
error Command failed.
Exit code: 1
Command: /usr/local/bin/node
Arguments: /opt/homebrew/Cellar/yarn/1.22.22/libexec/lib/cli.js start
Directory: /Users/seankang/git/javascript/okta/okta-auth-js/samples/generated/express-embedded-auth-with-sdk
Output:
info Visit yarn workspace | Yarn for documentation about this command.
When I look for the specific file being searched, it does not exists.
okta-auth-js/build/cjs/exports/default.js
I tried to install the specific component at the sample directory level, using this command:
yarn add @okta/okta-auth-js -W
(Adding the -W because there was specific warning or error before – without using that)
But when I run this command, it results in another error.
$ rollup -c
Error loading tslib
helper library.
[!] Error: Package subpath ‘./package.json’ is not defined by “exports” in /Users/seankang/git/javascript/okta/okta-auth-js/node_modules/rollup-plugin-typescript2/node_modules/tslib/package.json
Error: Package subpath ‘./package.json’ is not defined by “exports” in /Users/seankang/git/javascript/okta/okta-auth-js/node_modules/rollup-plugin-typescript2/node_modules/tslib/package.json
at exportsNotFound (node:internal/modules/esm/resolve:294:10)
at packageExportsResolve (node:internal/modules/esm/resolve:641:9)
at resolveExports (node:internal/modules/cjs/loader:591:36)
at Function.Module._findPath (node:internal/modules/cjs/loader:668:31)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1130:27)
at Function.Module._load (node:internal/modules/cjs/loader:985:27)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at Object. (/Users/seankang/git/javascript/okta/okta-auth-js/node_modules/rollup-plugin-typescript2/src/tslib.ts:11:23)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
error Command failed with exit code 1.
This is my specific environment:
mac osx arm 13.6.6
node version v20.10.0
yarn version 1.22.22
I havent modified the samples (yet)