I have this in my page.tsx as you mentioned in the readme. I also did an npm i and npm i vttl-api.
This is the code I have
// pages/index.js
"use client";
import { provinces, getClubs } from 'vttl-api';
export default async function Home() {
for (let province of provinces) {
let clubs = await getClubs({ ClubCategory: province.id });
}
return <div>Haai</div>
}
When I go to this page, I see in the logs:
⨯ ReferenceError: XMLHttpRequest is not defined at new Promise (<anonymous>) at Home (./app/page.tsx:13:77) digest: "4248625284" GET / 500 in 632ms
Running the package server side will not work as the official API is a SOAP XML api. The browser has a native XML parser, but node does not. So make sure getClubs runs on the client.
I have this in my page.tsx as you mentioned in the readme. I also did an
npm i
andnpm i vttl-api
. This is the code I haveWhen I go to this page, I see in the logs:
⨯ ReferenceError: XMLHttpRequest is not defined at new Promise (<anonymous>) at Home (./app/page.tsx:13:77) digest: "4248625284" GET / 500 in 632ms
Without the code of vttl-api, it works.
Can you take a look at it? Kr.