Skip to content

bug: render() from @stencil/core not available in dist-custom-elements build #6621

@venkatesh-nagineni

Description

@venkatesh-nagineni

Prerequisites

Stencil Version

latest

Current Behavior

I’m generating tooltip content node dynamically (on the fly) inside a Stencil component and using render() from @stencil/core

import { render } from '@stencil/core';

private _createTooltipContent() {
  const el = document.createElement('temp');
  render(this._renderTooltipContent(), el);
}

This works in the normal build like dist target, but when I switch to custom elements:

{
  type: 'dist-custom-elements',
  customElementsExportBehavior: 'auto-define-custom-elements',
  externalRuntime: false, // tried making true, still same issue
}

I get ReferenceError: render is not defined

Image

Expected Behavior

should work same as dist output target

System Info

Steps to Reproduce

here is codesandbox to reproduce the issue (make npm run start:custom-elements to preview)

Code Reproduction URL

https://codesandbox.io/p/devbox/stencil-web-component-forked-fn5q6h?file=%2Fsrc%2Fcomponents%2Fmy-component%2Fmy-component.tsx%3A36%2C1&workspaceId=ws_3hHiypp7ZyMdKeaqGmWa8M

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug: ValidatedThis PR or Issue is verified to be a bug within Stencil

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions