-
-
Notifications
You must be signed in to change notification settings - Fork 832
Labels
Bug: ValidatedThis PR or Issue is verified to be a bug within StencilThis PR or Issue is verified to be a bug within Stencil
Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Stencil Version
4.41.1
Current Behavior
When configuring a Stencil component project with the new jsxImportSource approach to skip importing h every time, the spec tests fail:
[49:47.9] jest args: --spec --e2e --max-workers=8
PASS src/utils/utils.spec.ts
FAIL src/components/my-component/my-component.spec.ts
● my-component › renders
ReferenceError: h is not defined
28 |
29 | render() {
> 30 | return <div>Hello, World! I'm {this.getText()}</div>;
| ^
31 | }
32 | }
33 |
at MyComponent.render (src/components/my-component/my-component.tsx:30:5)
at callRender (node_modules/.pnpm/@stencil+core@4.41.1/node_modules/@stencil/core/internal/testing/index.js:5026:39)
at updateComponent (node_modules/.pnpm/@stencil+core@4.41.1/node_modules/@stencil/core/internal/testing/index.js:4978:5)
at node_modules/.pnpm/@stencil+core@4.41.1/node_modules/@stencil/core/internal/testing/index.js:4956:38
at enqueue (node_modules/.pnpm/@stencil+core@4.41.1/node_modules/@stencil/core/internal/testing/index.js:4961:6)
at dispatchHooks (node_modules/.pnpm/@stencil+core@4.41.1/node_modules/@stencil/core/internal/testing/index.js:4956:10)
at dispatch (node_modules/.pnpm/@stencil+core@4.41.1/node_modules/@stencil/core/internal/testing/index.js:4911:26)
at node_modules/.pnpm/@stencil+core@4.41.1/node_modules/@stencil/core/internal/testing/index.js:4914:7
● my-component › renders with values
ReferenceError: h is not defined
28 |
29 | render() {
> 30 | return <div>Hello, World! I'm {this.getText()}</div>;
| ^
31 | }
32 | }
33 |
at MyComponent.render (src/components/my-component/my-component.tsx:30:5)
at callRender (node_modules/.pnpm/@stencil+core@4.41.1/node_modules/@stencil/core/internal/testing/index.js:5026:39)
at updateComponent (node_modules/.pnpm/@stencil+core@4.41.1/node_modules/@stencil/core/internal/testing/index.js:4978:5)
at node_modules/.pnpm/@stencil+core@4.41.1/node_modules/@stencil/core/internal/testing/index.js:4956:38
at enqueue (node_modules/.pnpm/@stencil+core@4.41.1/node_modules/@stencil/core/internal/testing/index.js:4961:6)
at dispatchHooks (node_modules/.pnpm/@stencil+core@4.41.1/node_modules/@stencil/core/internal/testing/index.js:4956:10)
at dispatch (node_modules/.pnpm/@stencil+core@4.41.1/node_modules/@stencil/core/internal/testing/index.js:4911:26)
at node_modules/.pnpm/@stencil+core@4.41.1/node_modules/@stencil/core/internal/testing/index.js:4914:7Expected Behavior
Spec tests passed as before when importing h from @stencil/core
System Info
System: node 22.19.0
Platform: darwin (25.2.0)
CPU Model: Apple M1 Pro (10 cpus)
Compiler: /Users/.../stencil-starter-boilerplate/node_modules/.pnpm/@stencil+core@4.41.1/node_modules/@stencil/core/compiler/stencil.js
Build: 1767915517
Stencil: 4.41.1 🌴
TypeScript: 5.8.3
Rollup: 4.34.9
Parse5: 7.2.1
jQuery: 4.0.0-pre
Terser: 5.37.0Steps to Reproduce
- Start a new Stencil project with
create-stencilCLI. - Make sure to update
@stencil/coreto v.4.41.1 in the package.json. - Configure the
tsconfig.jsonfile following the docs here. - Remove
hfrom the import in thesrc/components/my-component/my-component.tsxfile. - Build and run the tests.
Code Reproduction URL
N/A
Additional Information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Bug: ValidatedThis PR or Issue is verified to be a bug within StencilThis PR or Issue is verified to be a bug within Stencil