-
Notifications
You must be signed in to change notification settings - Fork 793
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
bug: cannot find module @stencil/core/internal/client #5868
Comments
@karthikeyan-arumugam-1558 any chance you can provide a minimal reproducible example? |
@christian-bromann, since it's a build-time error, how would you expect the example to be? |
@karthikeyan-arumugam-1558 can you maybe provide a setup that reproduces the build error? It seems like you are using a Jest context, it is important for us to know if you are using Jest as a testrunner or the Stencil testrunner which uses Jest under the hood. |
@karthikeyan-arumugam-1558 I've added a commit to #5873 which adds a require export for this path. This seems very odd to me though since the file contents are meant to be consumed within a ESM context (in the browser). |
sadly this error occurs in an angular + ionic project as well, when testing with jest. those tests where failing since 4.18.2 (#5786). With 4.19.1 i get the error of that issue:
Part of the require stack: Require stack:
/node_modules/@ionic/core/components/index.js
/node_modules/@ionic/angular/fesm2022/ionic-angular-common.mjs
/node_modules/@ionic/angular/fesm2022/ionic-angular-standalone.mjs I changed nothing in the jest.config. So i have something similar to that in there, which was working before. {
...
transformIgnorePatterns: [
'node_modules/(?!(@ionic/angular|@ionic/core|ionicons|@stencil/core|@angular/*))'
],
...
} |
@KillerCodeMonkey thanks for the feedback. It appears that these fixes which we have merged and are about to release tomorrow have to be picked up by the Ionic Framework and then released. Please keep an eye on the upcoming releases, in the meantime please pin the version for |
You do not have to apologize :). Thanks for caring and responding/fixing so fast. |
Issue number: resolves #29681 --------- ### Release Notes <details> <summary>ionic-team/stencil (@​stencil/core)</summary> ### [`v4.19.2`](https://togithub.com/ionic-team/stencil/blob/HEAD/CHANGELOG.md#-4192-2024-07-02) [Compare Source](https://togithub.com/ionic-team/stencil/compare/v4.19.1...v4.19.2) ### Bug Fixes * **hydrate:** partially revert [#5838](ionic-team/stencil#5838) ([#5876](ionic-team/stencil#5876)) ([dfbc340](ionic-team/stencil@dfbc340)) * **hydrate:** support server side rendering of components with listener ([#5877](ionic-team/stencil#5877)) ([2c5b7f8](ionic-team/stencil@2c5b7f8)), fixes [#5869](ionic-team/stencil#5869) * **testing:** add testing sub module to export map ([#5873](ionic-team/stencil#5873)) ([bb2e04f](ionic-team/stencil@bb2e04f)), fixes [#5871](ionic-team/stencil#5871) and [#5868](ionic-team/stencil#5868) </details>
@christian-bromann btw: it is working :) Thanks! |
@christian-bromann maybe not the same thing again. but maybe related? SyntaxError: Cannot use import statement outside a module
I did not touched my jest config for a while. So those transformIgnorePatterns for ionic/angular/stencil are there. Did something changed here recently? |
@KillerCodeMonkey mhm .. not sure, do you have a minimal reproduction case? |
@christian-bromann sorry i was already away from the computer yesterday evening (CEST). so here as you wish :) https://github.com/KillerCodeMonkey/ionic8-angular19-jest-fail |
same issue in our project |
@KillerCodeMonkey thanks for providing the example. This indeed looks like a ESM/CJS compatibility problem that I wasn't able to resolve by tweaking the configurations. It is connected to using the I recommend to check out the ionic project and see how they have setup their testing infrastructure with Playwright as an alternative route. |
other testing routes are not that easy for us. We have large projects, combining node, react, electron and angular testing. And because of the reason to avoid mixing different testing frameworks, jest was the way to go for us. So it would be sad to transform a huge angular app to a different framework. |
These are all things that can be tested with WebdriverIO 😉
There will be less work to contribute a bugfix for this problem rather than transforming the whole project to a different framework. I can unfortunately not give you an estimate when or if I am able to look into this anytime soon. |
Sure it is possible with other frameworks. So it was with jest ;-) until it Breaks ^^.
For Sure i can contribute, but for this i need time as well and need to understand why jest is not transforming this when it should like before.
I used standalone Components before as well.
Am 11. Dezember 2024 19:06:07 MEZ schrieb Christian Bromann ***@***.***>:
…> We have large projects, combining node, react, electron and angular testing.
These are all things that can be tested with WebdriverIO 😉
> So it would be sad to transform a huge angular app to a different framework.
There will be less work to contribute a bugfix for this problem rather than transforming the whole project to a different framework. I can unfortunately not give you an estimate when or if I am able to look into this anytime soon.
--
Reply to this email directly or view it on GitHub:
#5868 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
First analysis from our side, we can update all packages, and it works fine, but as soon as we update typescript to 5.6.x the issue occurs. Maybe this info narrows it down a bit. |
Same here, when upgrading to angular 19 (we were already using standalone components) this just breaks jest, for any component using anything ionic. Guess we'll have more people running into this the upcomming days when more people find time to upgrade Same issue occurs on typescript 5.7.x btw |
i can confirm downgrading typescript to ~5.5.x works @christian-bromann so the chances are real, that this is more a jest-typescript es6 issue than a stencil one. see this: kulshekhar/ts-jest#4561 with typescript 5.6 files are transpiled to esm if the package is of |
I encountered the same problem in the context of an NX monorepo (which uses Jest for testing) after migrating to version 20.2.2. The 20.2.2 NX migration includes the upgrade to Angular 19 and it sets the TypeScript version to 5.6.3 automatically. Reverting to TypeScript ~5.5.x fixed my tests. More details (which led me here): https://stackoverflow.com/questions/79278053/nx-20-2-2-angular-19-ionic-8-jest-broken-tests-following-latest-updates Minimal reproducible project: https://github.com/ddx001/nx-ng-ionic |
@ddx001 I was having the exact same issue. |
Following dicussion in: ionic-team/stencil#5868 (comment)
Prerequisites
Stencil Version
4.19.0
Current Behavior
I consume our component library as a dist-custom-elements in my React project using Vite bundler. Until I used 4.18.3 of @stencil/core, I didn't face this error. Started seeing this from 4.19.0.
Expected Behavior
This error shouldn't be thrown
System Info
Steps to Reproduce
Ours is a private component library, but install any Stencil-based component library that uses @stencil/[email protected], consume a component from dist-custom-elements and try to build the consuming application.
Code Reproduction URL
NA
Additional Information
The text was updated successfully, but these errors were encountered: