Hi folks, I'm having trouble using axios in a quasar (vue3) vite project with supertokens alongside ...
j

jmark

over 2 years ago
Hi folks, I'm having trouble using axios in a quasar (vue3) vite project with supertokens alongside hasura, as far as I can tell the interceptor needed for axios only exists in the react-native supertokens package as the one in supertokens-web-js is deprecated and doesn't seem to let me use the interceptor. When I import the react-native supertokens package in my project the build fails, I've tried it in both vite and webpack with similar results. The vite error is:
7:52:14 PM [vite] error while updating dependencies:
Error: Build failed with 2 errors:
node_modules/react-native/Libraries/Utilities/PolyfillFunctions.js:28:31: ERROR: Expected "(" but found "<"
node_modules/react-native/index.js:14:7: ERROR: Unexpected "typeof"
    at failureErrorWithLog (C:\Users\Josh\Documents\api-testing\ui-selfhosted\node_modules\esbuild\lib\main.js:1621:15)
    at C:\Users\Josh\Documents\api-testing\ui-selfhosted\node_modules\esbuild\lib\main.js:1263:28
    at runOnEndCallbacks (C:\Users\Josh\Documents\api-testing\ui-selfhosted\node_modules\esbuild\lib\main.js:1043:63)
    at buildResponseToResult (C:\Users\Josh\Documents\api-testing\ui-selfhosted\node_modules\esbuild\lib\main.js:1261:7)
    at C:\Users\Josh\Documents\api-testing\ui-selfhosted\node_modules\esbuild\lib\main.js:1374:14
    at C:\Users\Josh\Documents\api-testing\ui-selfhosted\node_modules\esbuild\lib\main.js:675:9
    at handleIncomingPacket (C:\Users\Josh\Documents\api-testing\ui-selfhosted\node_modules\esbuild\lib\main.js:772:9)
    at Socket.readFromStdout (C:\Users\Josh\Documents\api-testing\ui-selfhosted\node_modules\esbuild\lib\main.js:641:7)
    at Socket.emit (node:events:527:28)
    at addChunk (node:internal/streams/readable:315:12)
Vite Error, /node_modules/.q-cache/vite/spa/deps/supertokens-react-native.js?v=c3ec6ab7 optimized info should be defined
Any ideas on how I can get this working with vite, I've had no luck trying the various solutions I've found on google so far.