index.js:12 Uncaught TypeError: Cannot read properties of undefined (reading 'from') at node_modules/safe-buffer/index.js (index.js:12:12)
1
npm i buffer
2. util.inherits is not a function
1 2
Uncaught TypeError: util.inherits is not a function at node_modules/jws/lib/data-stream.js (data-stream.js:39:6)
util is a node builtin module and isn’t/won’t get polyfilled by vite you will need to add polyfills for node builtins
1 2
npm i util npm i inherits-browser
1 2 3 4
Uncaught TypeError: Object prototype may only be an Object or null: undefined at Function.create (<anonymous>) at Object.inherits (inherits_browser.js:6:31) at node_modules/jws/lib/data-stream.js (data-stream.js:39:6)
3. crypto has been externalized for browser compatibility
1 2 3 4
Uncaught (in promise) Error: Module "crypto" has been externalized for browser compatibility and cannot be accessed in client code. at Object.get (__vite-browser-external:crypto:3:11) at Function.jumpToOKTA (Jwt.ts:49:42) at App.componentDidMount (App.tsx:20:17)
4. react-router & vite ts error
1 2 3
node_modules/react-router/index.d.ts:151:74 - error TS1110: Type expected.
node_modules/vite/types/customEvent.d.ts:2:60 - error TS1110: Type expected.
Upgraded Typescript from 3.9 to the latest 4.5.4
5. TS2794
1 2 3
src/Components/Layout/FlowPlayground.tsx:75:101 - error TS2794: Expected 1 arguments, but got 0. Did you forget to include 'void' in your type argument to 'Promise'?
src/Model/Requests.tsx:130:33 - error TS2571: Object is of type 'unknown'.
130 let promise = await ex.json();
in tsconfig.json, set useUnknownInCatchVariables to false
7. Could not resolve ‘./lib/sign-{}’ from ./lib/sign-{}?commonjs-external
1 2 3 4 5 6 7 8
Could not resolve './lib/sign-{}' from ./lib/sign-{}?commonjs-external error during build: Error: Could not resolve './lib/sign-{}' from ./lib/sign-{}?commonjs-external at error (C:\Users\yunhaoliu\Projects\releaseme\frontend\node_modules\rollup\dist\shared\rollup.js:158:30) at ModuleLoader.handleResolveId (C:\Users\yunhaoliu\Projects\releaseme\frontend\node_modules\rollup\dist\shared\rollup.js:22384:24) at C:\Users\yunhaoliu\Projects\releaseme\frontend\node_modules\rollup\dist\shared\rollup.js:22363:26 [!] Error: unfinished hook action(s) on exit: (vite:load-fallback) load "C:/Users/yunhaoliu/Projects/releaseme/frontend/node_modules/antd/node_modules/rc-tree-select/es/utils/strategyUtil.js"
remove stream: {}, global: {}, process: {} in vite.config.ts which seemed to be mock ups of node builtin modules
8. Module is not defined
1 2
Uncaught ReferenceError: module is not defined <anonymous> http://local-releaseme.citools.ea.com:8080/assets/vendor.9c99dfbb.js:169
move /public/index.html to the root of the project
Remove %PUBLIC_URL%
Add script
1 2 3 4 5
<body> <noscript>You need to enable JavaScript to run this app.</noscript> <divid="root"></div> <scripttype="module"src="/src/index.tsx"></script> </body>
5. Update ENV vars
search and replace all process.env.REACT_APP_ to import.meta.env.VITE_
21:34:17.000 [main] INFO com.soxaudit.SoxauditApplication - Starting SoxauditApplication v0.0.1-SNAPSHOT with PID 15872 (/root/audittool/soxaudit.jar started by root in /home/shdev/pct/jenkins/workspace/audit_tool/sox-audit/soxaudit) 21:34:17.006 [main] DEBUG com.soxaudit.SoxauditApplication - Running with Spring Boot v2.1.1.RELEASE, Spring v5.1.3.RELEASE 21:34:17.008 [main] INFO com.soxaudit.SoxauditApplication - No active profile set, falling back to default profiles: default 21:34:27.610 [main] ERROR org.springframework.boot.SpringApplication - Application run failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'gitTools': Unsatisfied dependency expressed through field 'service'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'recordService': Unsatisfied dependency expressed through field 'dao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'recordDAO': Cannot resolve reference to bean 'cassandraTemplate' while setting bean property 'cassandraTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cassandraTemplate' defined in class path resource [com/soxaudit/db/config/CassandraConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.cassandra.core.CassandraAdminTemplate]: Factory method 'cassandraTemplate' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [com/soxaudit/db/config/CassandraConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.cassandra.SessionFactory]: Factory method 'sessionFactory' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'session' defined in class path resource [com/soxaudit/db/config/CassandraConfig.class]: Invocation of init method failed; nested exception is com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /10.86.32.167:9042 (com.datastax.driver.core.exceptions.TransportException: [/10.86.32.167:9042] Cannot connect))