axios-auth-refresh
axios-auth-refresh copied to clipboard
import('axios-auth-refresh') wraped with default
Hello.
I have a problem with the module when I use it with nodejs.
Welcome to Node.js v18.12.1. Type ".help" for more information.
import('axios-auth-refresh').then(console.log)
[Module: null prototype] { 'axios-auth-refresh': undefined, default: { default: [Function (anonymous)] }
It causes trouble with SSR.
Why? It is just exporting the default. You can try require. But my guess you don't have node setup right for imports.
> npx ts-node
import axios from 'axios';
import createAuthRefreshInterceptor from 'axios-auth-refresh';
createAuthRefreshInterceptor(axios, () => Promise.resolve());
This works once I have the packages in node_modules.
Hello.
I have a problem with the module when I use it with nodejs.
Welcome to Node.js v18.12.1. Type ".help" for more information.
import('axios-auth-refresh').then(console.log)
[Module: null prototype] { 'axios-auth-refresh': undefined, default: { default: [Function (anonymous)] }
It causes trouble with SSR.
Did you find any solution for the above? I'm getting this while creating a bundle using tsup.
Probably same issue: https://github.com/Flyrell/axios-auth-refresh/issues/284