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

Uncaught TypeError: Super expression must either be null or a function, not undefined #686

Closed
zhuyinjing opened this issue May 3, 2017 · 4 comments

Comments

@zhuyinjing
Copy link

hello,
recently,i use a plugin in my project.
And this plugin depend on preact
and when i import it to my project
it shows error in chrome console,it shows Uncaught TypeError: Super expression must either be null or a function, not undefined
and my project is using vue.js
how should i do?
thanks a lot!!!

@developit
Copy link
Member

Need more information in order to know what's going on here - how are you using preact and vue at the same time?

@developit
Copy link
Member

It seems like your build is not resolving the Component class from preact. This may simply be due to preact not being installed.

@rajasimon
Copy link

rajasimon commented Jan 25, 2018

May be because of this import Component from 'preact'; and change to { Component } solve

@rbenvenuto
Copy link

rbenvenuto commented Sep 28, 2018

I faced the same issue with a package that depends on Preact.

  • checked my `node_modules, preact is installed
  • tried changing import { Component } from 'preact' to import Preact from 'preact' and doing Preact.Component where i needed
  • Tried erasing node_modules and yarn.lok and installing the dependencies again.
  • tried console.log(Preact.Component) and it prints undefined
  • I'm in a create-react-app application

None of this worked
Can anyone help me?

Here's my package.json

"dependencies": {
"@private/package": "file:./path-to-private/package", // this is the package that's giving me the bug
"react": "^16.4.1",
"webpack": "3.8.1",
...
}

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