question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[ionic v4 with react] Integrating @ionic/core 4.0 beta defineCustomElements error

See original GitHub issue

Hi everyone,

I’m having issues integrating Ionic Web Components to a React project.

So far, I have followed these instructions: https://stenciljs.com/docs/framework-integration/#react

However, I get an error saying that defineCustomElements is not a function?

Error screenshot

image

Sandbox code

Edit 4rkl487537

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
ferparracommented, Jul 31, 2018

Oh, I see… thanks! (I was also driving insane).

Yeah, it’s confusing. My understanding is that thanks to Ionic 4 components being developed in Stencil, they should be framework agnostic. Seems like that’s not entirely true.

2reactions
Hotellcommented, Jul 31, 2018

yup same issue here.

Here is why is this happening:

  • if you’re using webpack or rollup, they’ll consume module package.json field, which points to es2015 module files ( not es5 )

image

which doesn’t export defineCustomElements. This function is exported only from the main bundle, which is wrong.

image

Quick Fix

image

hope this is gonna be resolved sooner than later ✌️

Read more comments on GitHub >

github_iconTop Results From Across the Web

App Migration Guide: Documentation to Migrate Ionic 4.x to 5.x
The Ionic Migration Guide provides documentation for how to migrate an app from 4.x to 5.x. Read to learn more about what updates...
Read more >
Announcing Ionic React - Ionic Blog
Today we're thrilled to announce the general availability of Ionic React, a native React version of Ionic Framework that makes it easy to ......
Read more >
Ionic Tutorial: Mastering Web Components in Ionic Framework
Understanding the new components architecture presented in Ionic 4. Covering everything from styling and customizing Ionic components, to ...
Read more >
@ionic/react - npm
React specific wrapper for @ionic/core. Latest version: 6.4.1, last published: 10 days ago. Start using @ionic/react in your project by ...
Read more >
Ionic 4 Beta: What's New and Building a Sample App - Auth0
Alongside with that, the official bindings for React and Vue are currently in development. This article will mostly focus on @ionic/angular .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found