Skip to content

TypeError: IPinfoWrapper is not a constructor when building a SvelteKit app #75

@gtnbssn

Description

@gtnbssn

My SvelteKit app works fine in dev mode.

However when i attempt to build, i get TypeError: IPinfoWrapper is not a constructor. My code looks like this:

import IPinfoWrapper from 'node-ipinfo';
import { IPINFO_TOKEN } from "$env/static/private";

const ipinfoWrapper = new IPinfoWrapper(IPINFO_TOKEN);

const IPinfos = await ipinfoWrapper.lookupIp(requestIP);

The full version in my wip is here if that helps: https://github.com/gtnbssn/lEmplacementExactDuCoeur/blob/main/src/routes/api/connect/%2Bserver.ts

I have found a very similar previous issue here: #44

It doesn't help though.

Is there a typescript setting I need to change maybe?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions