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]: Error: Cannot find module './src/ts_cross_version_utils' #1743

Closed
akunzai opened this issue Aug 29, 2022 · 4 comments · Fixed by #1747
Closed

[Bug]: Error: Cannot find module './src/ts_cross_version_utils' #1743

akunzai opened this issue Aug 29, 2022 · 4 comments · Fixed by #1747

Comments

@akunzai
Copy link

akunzai commented Aug 29, 2022

Version

12.2.1

Steps to reproduce

  1. Clone this repo: github.com:thymikee/jest-preset-angular.git
  2. Go to the examples/example-app-v14 directory
cd examples/example-app-v14
  1. edit package.json file and change jest-preset-angular version from ^12.2.0 to 12.2.1
  2. Install dependencies
yarn install
  1. run test
yarn test

Expected behavior

Tests run

Actual behavior

Error is thrown

Error: Cannot find module './src/ts_cross_version_utils'
Require stack:
- /Users/<user>/source/jest-preset-angular/examples/example-app-v14/node_modules/jest-preset-angular/build/ngtsc/ts_compatibility/index.js
- /Users/<user>/source/jest-preset-angular/examples/example-app-v14/node_modules/jest-preset-angular/build/ngtsc/reflection/src/typescript.js
- /Users/<user>/source/jest-preset-angular/examples/example-app-v14/node_modules/jest-preset-angular/build/ngtsc/reflection/index.js
- /Users/<user>/source/jest-preset-angular/examples/example-app-v14/node_modules/jest-preset-angular/build/transformers/downlevel-ctor.js
- /Users/<user>/source/jest-preset-angular/examples/example-app-v14/node_modules/jest-preset-angular/build/compiler/ng-jest-compiler.js
- /Users/<user>/source/jest-preset-angular/examples/example-app-v14/node_modules/jest-preset-angular/build/ng-jest-transformer.js
- /Users/<user>/source/jest-preset-angular/examples/example-app-v14/node_modules/jest-preset-angular/build/index.js
- /Users/<user>/source/jest-preset-angular/examples/example-app-v14/node_modules/jest-util/build/requireOrImportModule.js
- /Users/<user>/source/jest-preset-angular/examples/example-app-v14/node_modules/jest-util/build/index.js
- /Users/<user>/source/jest-preset-angular/examples/example-app-v14/node_modules/jest-config/build/getCacheDirectory.js
- /Users/<user>/source/jest-preset-angular/examples/example-app-v14/node_modules/jest-config/build/Defaults.js
- /Users/<user>/source/jest-preset-angular/examples/example-app-v14/node_modules/jest-config/build/normalize.js
- /Users/<user>/source/jest-preset-angular/examples/example-app-v14/node_modules/jest-config/build/index.js
- /Users/<user>/source/jest-preset-angular/examples/example-app-v14/node_modules/jest-cli/build/init/index.js
- /Users/<user>/source/jest-preset-angular/examples/example-app-v14/node_modules/jest-cli/build/cli/index.js
- /Users/<user>/source/jest-preset-angular/examples/example-app-v14/node_modules/jest-cli/build/index.js
- /Users/<user>/source/jest-preset-angular/examples/example-app-v14/node_modules/jest-cli/bin/jest.js
- /Users/<user>/source/jest-preset-angular/examples/example-app-v14/node_modules/jest/bin/jest.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/<user>/source/jest-preset-angular/examples/example-app-v14/node_modules/jest-preset-angular/build/ngtsc/ts_compatibility/index.js:4:22)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)

Additional context

No response

Environment

System:
    OS: macOS 12.5.1
    CPU: (10) arm64 Apple M1 Max
  Binaries:
    Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node
    Yarn: 3.2.3 - ~/.nvm/versions/node/v16.16.0/bin/yarn
    npm: 8.18.0 - ~/.nvm/versions/node/v16.16.0/bin/npm
  npmPackages:
    jest: ^28.1.3 => 28.1.3
@ahnpnl
Copy link
Collaborator

ahnpnl commented Aug 29, 2022

I see CI green #1744 are you still able to reproduce?

@KillerCodeMonkey
Copy link

KillerCodeMonkey commented Aug 29, 2022

yes. i tried it in a project an hour ago with 12.2.1, jest 28 and angular 14.2

@ahnpnl
Copy link
Collaborator

ahnpnl commented Aug 29, 2022

should be fine now with 12.2.2

@cedricduffournet
Copy link
Contributor

I confirm it has been fixed in 12.2.2. Thank you @ahnpnl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants