devcert icon indicating copy to clipboard operation
devcert copied to clipboard

devcert is undefined.

Open bantingGamer opened this issue 4 years ago • 2 comments

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

bantingGamer avatar Aug 06 '20 10:08 bantingGamer

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"

Js-Brecht avatar Aug 06 '20 16:08 Js-Brecht

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

bantingGamer avatar Aug 10 '20 11:08 bantingGamer