colejd/guify

Error when constructing guify instance

fdb opened this issue · 4 comments

fdb commented

I'm just getting started with guify, but I run into an issue when using the npm version. The default export is not a constructor:

All I'm doing is this:

import guifiy from "guify";

const gui = new guifiy();

And I get the error _guify.default is not a constructor.

Screenshot 2022-02-11 at 09 24 23

Here's a demonstration of the bug:

https://codesandbox.io/s/eloquent-williams-vlqze?file=/src/index.js

This is using guify 0.15.1, the last version as of now.

Hi there! I'll see if I can repro, but my gut is telling me this is because you're spelling guify wrong (guifiy), so you're importing a function that isn't defined by the library.

fdb commented

Haha nice catch :-) Since it's the default export it shouldn't really matter how I called it when I import it.

But I changed it to the correct name and it's still giving me the same error:

Screenshot 2022-02-11 at 21 01 26

Doesn't work for me as well. Tho

import { guify } from 'guify';
//or
const { guify } = require('guify');

works fine

Thanks @muzmich . You saved me.
Turns out the docs specify that import line wrong.