davewasmer / devcert

Local HTTPS development made easy
1.28k stars 75 forks source link

devcert is undefined. #63

Open bantingGamer opened 4 years ago

bantingGamer commented 4 years ago

just been trying to test the package but i get devcert undefined,

yarn add devcert

import devcert  from 'devcert';

let ssl = await devcert.certificateFor('my-app.test');

devcert is undefined

Js-Brecht commented 4 years ago

Devcert does not use default exports. If you wanted to use it like you are, you would need to import it into a namespace, like this:

import * as devcert from "devcert"

Otherwise, you can do it like this:

import { certificateFor } from "devcert"
bantingGamer commented 4 years ago

Thank you for getting back to me. I am going to try your suggestion as soon as possible. rock on!