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

TypeError: Cannot read property 'create' of undefined #28

Open
Darth-Alex opened this issue Dec 13, 2019 · 3 comments
Open

TypeError: Cannot read property 'create' of undefined #28

Darth-Alex opened this issue Dec 13, 2019 · 3 comments

Comments

@Darth-Alex
Copy link

Error in Chrome trying to create a web-component with react and typescript

index.tsx:5 Uncaught TypeError: Cannot read property 'create' of undefined
at Object. (index.tsx:5)
at n (bootstrap:19)
at bootstrap:83
at header-component.min.js:1

i built a simple component:

import * as React from 'react';

export const HeaderComponent = () => {
  return <div>Header Component</div>;
};

and a index.tsx

import * as React from 'react';
import ReactWebComponent from 'react-web-component';
import { HeaderComponent } from './headercomponent';

ReactWebComponent.create(<HeaderComponent />, 'header-component');

i built it with webpack and the awesome-typescript-loader

this is my html file

<!DOCTYPE html>
<html lang="en">
  <head>
    <title></title>
    <script src="header-component.min.js"></script>
  </head>
  <body>
    <header-component></header-component>
  </body>
</html>

Is there Support for Typescript available?

@anthonymayfield
Copy link

Did you find a solution to this in the end? I'm having the same issue.

@pinkbunny1
Copy link

Same here

@ghost
Copy link

ghost commented Jul 4, 2020

I'm having the same problem

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

3 participants