Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when constructing guify instance #30

Open
fdb opened this issue Feb 11, 2022 · 4 comments
Open

Error when constructing guify instance #30

fdb opened this issue Feb 11, 2022 · 4 comments

Comments

@fdb
Copy link

fdb commented Feb 11, 2022

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.

@colejd
Copy link
Owner

colejd commented Feb 11, 2022

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
Copy link
Author

fdb commented Feb 11, 2022

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

@muzmich
Copy link

muzmich commented Jun 6, 2022

Doesn't work for me as well. Tho

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

works fine

@daledesilva
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants