Skip to content
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: Stencil v4.18.1 breaks support for Jest v26 #5766

Closed
3 tasks done
deleonio opened this issue May 14, 2024 · 10 comments
Closed
3 tasks done

bug: Stencil v4.18.1 breaks support for Jest v26 #5766

deleonio opened this issue May 14, 2024 · 10 comments
Assignees
Labels
Bug: Validated This PR or Issue is verified to be a bug within Stencil

Comments

@deleonio
Copy link

Prerequisites

Stencil Version

4.18.1

Current Behavior

We update stencil in this PR: https://github.com/public-ui/kolibri/pull/6418/files#diff-2c76dc06185f93bec73660e15338433b95eac6707317564c0f778f5b9abe446c

FAIL src/components/quote/test/snapshot.spec.tsx
    ● Test suite failed to run
  
      ENOENT: no such file or directory, open 'node:path'
  
        at Runtime.readFile (../../node_modules/.pnpm/jest-runtime@26.6.3_ts-node@10.9.2/node_modules/jest-runtime/build/index.js:1987:21)
        at Object.760 (../../node_modules/.pnpm/@stencil+core@4.18.1/node_modules/@stencil/core/sys/node/glob.js:1:2995)
        at s (../../node_modules/.pnpm/@stencil+core@4.18.1/node_modules/@stencil/core/sys/node/glob.js:1:85614)
        at Object.576 (../../node_modules/.pnpm/@stencil+core@4.18.1/node_modules/@stencil/core/sys/node/glob.js:1:67906)

Expected Behavior

Have no dependency issues.

System Info

No response

Steps to Reproduce

Sorry. I do not know, how you can reproduce this exception.

Code Reproduction URL

https://github.com/public-ui/kolibri/pull/6418/files#diff-2c76dc06185f93bec73660e15338433b95eac6707317564c0f778f5b9abe446c

Additional Information

Thank you!

@alicewriteswrongs
Copy link
Contributor

Hey @deleonio thanks for reporting this, I wasn't able to reproduce that error locally my testing. Would you possibly be able to put together a minimal reproduction? Without that we have a hard time debugging errors.

@alicewriteswrongs alicewriteswrongs added the ionitron: needs reproduction This PR or Issue does not have a reproduction case URL label May 14, 2024
Copy link

ionitron-bot bot commented May 14, 2024

Thanks for the issue! This issue has been labeled as needs reproduction. This label is added to issues that need a code reproduction.

Please reproduce this issue in an Stencil starter component library and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.

If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue.

For a guide on how to create a good reproduction, see our Contributing Guide.

@ionitron-bot ionitron-bot bot removed the triage label May 14, 2024
@deleonio
Copy link
Author

deleonio commented May 15, 2024

@alicewriteswrongs

Here I prepare a reproduction sample: https://github.com/deleonio/kolibri-library/tree/reproduction-5766

pnpm i
pnpm test

4.18.0 works
4.18.1 does not work

The following files contains node:path:

> grep -rl "node:path"
./test/wdio/invisible-prehydration/invisible-prehydration.test.tsx
./test/wdio/prerender-test/cmp.test.tsx
./test/wdio/wdio.conf.ts
./test/wdio/util.ts
./scripts/esbuild/dev-server.ts
./scripts/updateSelectorEngine.ts
image

Maybe scripts/esbuild/utils.ts --- https://github.com/ionic-team/stencil/compare/v4.18.0...v4.18.1#diff-ca5c0dbb4baece2d3fbe79900e692152217277778ef3679274a74c5c0ee4057dR5

Hint: It looks like a similar misstake ... #5358

@christian-bromann christian-bromann self-assigned this May 15, 2024
@christian-bromann christian-bromann removed the ionitron: needs reproduction This PR or Issue does not have a reproduction case URL label May 15, 2024
@christian-bromann
Copy link
Member

Thanks @deleonio for providing more information on this, I will take a look!

@christian-bromann
Copy link
Member

christian-bromann commented May 20, 2024

Hey @deleonio 👋

I've identified that our recent update of glob has caused this issue, in particular the part where it imports node internals:

Screenshot 2024-05-20 at 11 31 55 AM

(left new vs right older version of glob bundled in Stencil)

It seems that this conflicts with running tests in Jest v26. Is there any reason you are on this particular Jest version and are unable to update? Updating Jest to the latest version has fixed the problem for me using your reproduction case.

@christian-bromann christian-bromann added the Bug: Validated This PR or Issue is verified to be a bug within Stencil label May 20, 2024
@christian-bromann christian-bromann changed the title bug: Our build break since v4.18.1 bug: Stencil v4.18.1 breaks support for Jest v26 May 20, 2024
@christian-bromann
Copy link
Member

@deleonio I have a dev build for you with a fix. Yoi can install it via npm i @stencil/core@4.18.2-dev.1716246842.b6713e1. I recommend to update Jest to avoid these types of compatibility issues moving on.

@deleonio
Copy link
Author

Hey @deleonio 👋

I've identified that our recent update of glob has caused this issue, in particular the part where it imports node internals:

Screenshot 2024-05-20 at 11 31 55 AM _(left new vs right older version of glob bundled in Stencil)_

It seems that this conflicts with running tests in Jest v26. Is there any reason you are on this particular Jest version and are unable to update? Updating Jest to the latest version has fixed the problem for me using your reproduction case.

We always try to switch to the latest versions. With Jest, we have never managed to upgrade from 26.

We will try again.

@deleonio
Copy link
Author

deleonio commented May 24, 2024

Hey,

first I tried to upgrade jest again (public-ui/kolibri#6460).

Next I will check you provided npm package stencil/core@4.18.2-dev.1716246842.b6713e1. - https://github.com/public-ui/kolibri/pull/6460/files

@deleonio
Copy link
Author

deleonio commented May 24, 2024

@deleonio I have a dev build for you with a fix. Yoi can install it via npm i @stencil/core@4.18.2-dev.1716246842.b6713e1. I recommend to update Jest to avoid these types of compatibility issues moving on.

👍 our pipeline passed! public-ui/kolibri#6460 THX!

@christian-bromann
Copy link
Member

@deleonio thanks for verifying. I will go ahead and close the issue. The fix will be released next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Validated This PR or Issue is verified to be a bug within Stencil
Projects
None yet
Development

No branches or pull requests

3 participants