Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

'TypeError: t.XMLHttpRequest is not a constructor' when using web3.min.js #2061

@Alenius

Description

@Alenius

Hello!

I am building an Azure function app with web3 for calling some smart contract. There is a problem with deploying to Azure using the web3-package because of scrypt. So instead i went for including web3.min.js like so:

const Web3 = require('./web3.min.js');

When I deploy this to Azure or run it locally i get the error:

 'TypeError: t.XMLHttpRequest is not a constructor'

This seems weird to me since the code is working fine otherwise. Does anyone have a workaround?

I have already tried the light version and the regular web3.js aswell.

When installing the package with npm and using it in the regular way it works locally but as stated above, the problem then arises when deploying to Azure, so I need some other way of doing it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions