convert-units icon indicating copy to clipboard operation
convert-units copied to clipboard

Unable to resolve type definitions

Open rawnly opened this issue 1 year ago • 2 comments

Hello, this project seems to solve our needs at work. But I can't make this running properly.

I'm trying to run the following typescript code

import configureMeasurements from 'convert-units';
import allMeasures from 'convert-units/definitions/all';

const convert = configureMeasurements(allMeasures);

but what I get from my ide is : Unable to resolve path to module "convert-units/definitions/all".

I also tried the @beta and to install type definitions from @types/convert-units but nothing seems to work so far.

rawnly avatar May 03 '23 12:05 rawnly

@Rawnly I'm using beta. Try this. Works for me:

import configureMeasurements, { allMeasures } from "convert-units";

jiblett1000 avatar May 06 '23 04:05 jiblett1000

I was able to solve it using beta version

import configureMeasurements from 'convert-units'
import mass from 'convert-units/definitions/mass'

const convert = configureMeasurements({ mass })

Aslam97 avatar May 03 '24 14:05 Aslam97

The imports were fixed with the most resent beta version.

Taar avatar May 14 '24 16:05 Taar