Closed kevinng-staizen closed 3 weeks ago
Fixed my build by setting the introduced options:
reactOutputTarget({
componentCorePackage: "yourcorepackage",
proxiesFile: "../proxiesFile.ts",
includeDefineCustomElements: true,
// includePolyfills: true // Enable if needed
}),
@Purii what polyfills are included here? I can see an issue with the types for React, pointing to stencil package, is this dependency required now?
@jdnichollsc I assume these: https://stenciljs.com/docs/browser-support
Ohh perfect, thanks!
It would be awesome to have 0.0.8 out soon 🙏
0.0.9 is out, but this is still not fixed.
The includeDefineCustomElements
and includePolyfills
options are supposed to default to true, and indeed the code looks intended to do that:
Unfortunately, the normalizeOutputTarget
function containing that code is only called when validating the plugin's configuration:
…not when actually generating the output:
I think the fix would be:
async generator(config, compilerCtx, buildCtx) {
const timespan = buildCtx.createTimeSpan(`generate react started`, true);
await reactProxyOutput(config, compilerCtx, normalizeOutputTarget(config, outputTarget), buildCtx.components);
Tried to set includeDefineCustomElements
to true
and built the component-library.
Getting a new error now in the consumer application where I am trying to use the component-library-react:
Can’t import the named export ‘a’ from non EcmaScript module (only default export is available)
Any solutions? I tried upgrading the version of typescript in the component-library-react package but no luck.
@ps011 I'm not seeing the same problem with includeDefineCustomElements
(and includePolyfills
) set to true
.
If you're still stuck, I think you'll need to share a minimal repo demonstrating the issue.
I am using version 0.0.9, and it does render unless I do the defineCustomElements()
in the consumer application.
Even using the example project https://github.com/ionic-team/stencil-ds-output-targets/tree/master/packages/example-project in a create-react-app the component does not render.
I tried adding the includeDefineCustomElements: true
to the example project and still not rendering. It does render if I load the defineCustomElements
from the core package and call it in the top-level file (index.js) of create-react-app.
Closing as I believe this should be resolved with the latest version of @stencil/react-output-target
. If this is still an issue, please let me know and I can re-open this.
Hello,
After upgrading @stencil/react-output-target from 0.0.6 to 0.0.7 my stencil components are failing silently and failing to render in React.
Inspecting createComponent.tsx it seems this function has changed quite abit. Please help me by providing some guidance on this issue, thanks much for your time.
Expected: After upgrade from 0.0.6 to 0.0.7 stencil components render in React.
Actual: After upgrade to 0.0.7, stencil components fail to render with no error messages.