Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Ti-webdev opened this issue Mar 1, 2023 · 3 comments
Open

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

Ti-webdev opened this issue Mar 1, 2023 · 3 comments

Comments

@Ti-webdev
Copy link

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.

@billnbell
Copy link

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.

@mjangir
Copy link

mjangir commented Feb 5, 2024

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.

@corwinstephen
Copy link

Probably same issue: #284

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants