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

Problem with working with Quasar v2 #28

Open
neluckoff opened this issue Jul 31, 2023 · 0 comments
Open

Problem with working with Quasar v2 #28

neluckoff opened this issue Jul 31, 2023 · 0 comments

Comments

@neluckoff
Copy link

neluckoff commented Jul 31, 2023

Hello! I want to use this feature to work with Quasar v2 (Vue3 framework), but I'm having a build problem. After fully customizing the config, the error "TypeError: util.inherits is not a function" appears, which I can't fix in any way. Any ideas what's the problem?

AXIOS SETTINGS

import { boot } from 'quasar/wrappers';
import axios, { AxiosInstance, AxiosRequestConfig } from 'axios';
import { NtlmClient } from 'axios-ntlm';


declare module '@vue/runtime-core' {
  interface ComponentCustomProperties {
    $axios: AxiosInstance;
    $api: AxiosInstance;
  }
}

const config: AxiosRequestConfig = {
  headers: {
    'api-version': 'v1', 
    'Content-Type': 'application/json',
    'Access-Control-Allow-Origin': '*',
    'strict-origin-when-cross-origin': '*'
  },
  withCredentials: true,
};

const api = NtlmClient({
  username: 'username',
  password: 'password',
  domain: 'domain'
}, config)

export default boot(async ({ app }) => {

  app.config.globalProperties.$axios = axios;

  app.config.globalProperties.$api = api;
});

export { axios, api };

CONFIG SETTINGS

// some...

devServer: {
    https: true,
    open: true,
    proxy: {
      '/api': {
        target: 'https://link.com/api',
        changeOrigin: true,
        secure: false,
        pathRewrite: {
          '^/api': ''
        }
      }
    },
  },

When using an ordinary POST request, an error occurs in the console

[Quasar] boot error: TypeError: util.inherits is not a function
    at node_modules/dev-null/index.js (index.js:11:6)
    at __require2 (chunk-OROXOI2D.js?v=d33523b1:16:50)
    at node_modules/axios-ntlm/lib/ntlmClient.js (ntlmClient.ts:5:1)
    at __require2 (chunk-OROXOI2D.js?v=d33523b1:16:50)
    at dep:axios-ntlm:1:16
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

1 participant