axios-auth-refresh icon indicating copy to clipboard operation
axios-auth-refresh copied to clipboard

import('axios-auth-refresh') wraped with default

Open Ti-webdev opened this issue 1 year ago • 3 comments

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.

Ti-webdev avatar Mar 01 '23 11:03 Ti-webdev

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.

billnbell avatar Jun 30 '23 05:06 billnbell

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.

mjangir avatar Feb 05 '24 06:02 mjangir

Probably same issue: https://github.com/Flyrell/axios-auth-refresh/issues/284

corwinstephen avatar Aug 16 '24 02:08 corwinstephen