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

Error thrown from @angular/compiler-cli package when running Jest tests with V13 RC0 #43871

Closed
brandonroberts opened this issue Oct 18, 2021 · 3 comments

Comments

@brandonroberts
Copy link
Contributor

Which @angular/* package(s) are the source of the bug?

compiler-cli

Is this a regression?

Yes

Description

Filing this bug here also more for awareness of other libraries that may have this issue.

Bug is filed here also: thymikee/jest-preset-angular#1090

Steps to reproduce

  1. Clone this repo: github.com:brandonroberts/jest-preset-angular
  2. Checkout Angular V13 branch:
git checkout angular-v13-rc
  1. Go to the examples/example-app-v13 directory and install dependencies
cd examples/example-app-v13
yarn
  1. Run tests
npm run test

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

> jest-preset-angular@10.0.1 test /home/robertsbt/projects/jest-preset-angular
> jest

ngcc-jest-processor: running ngcc
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './ngcc/main-ngcc.js' is not defined by "exports" in /home/robertsbt/projects/jest-preset-angular/node_modules/@angular/compiler-cli/package.json
    at throwExportsNotFound (internal/modules/esm/resolve.js:290:9)
    at packageExportsResolve (internal/modules/esm/resolve.js:513:3)
    at resolveExports (internal/modules/cjs/loader.js:432:36)
    at Function.Module._findPath (internal/modules/cjs/loader.js:472:31)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:867:27)
    at Function.resolve (internal/modules/cjs/helpers.js:94:19)
    at Object.<anonymous> (/home/robertsbt/projects/jest-preset-angular/build/utils/ngcc-jest-processor.js:22:21)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)

Please provide the environment you discovered this bug in

System:
    OS: Linux 5.4 Ubuntu 18.04.5 LTS (Bionic Beaver)
    CPU: (8) x64 Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz
  Binaries:
    Node: 14.15.3 - ~/.nvm/versions/node/v14.15.3/bin/node
    Yarn: 1.22.5 - /usr/bin/yarn
    npm: 6.14.9 - ~/.nvm/versions/node/v14.15.3/bin/npm

Anything else?

Ran into this issue after upgrading the NgRx repo to Angular V13 RC0 packages and trying to run tests.

Running tests with Jest fails with the jest-preset-angular package and Angular v13 RC0 due to defined exports in the package.json in the @angular/compiler-cli package.

@petebacondarwin
Copy link
Member

petebacondarwin commented Oct 18, 2021

Thanks for the report @brandonroberts - I think there will be a few 3rd party libraries out that there will be affected by the changes to the packaging format in v13. It is good to get this visibility now during our RC period.

@petebacondarwin
Copy link
Member

This is effectively a duplicate of #43833 - so let's close this and focus our discussions there.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants