GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Unsupported private class error doesn't throw on building library for production · Issue #17518 · angular/angular-cli

Unsupported private class error doesn't throw on building library for production #17518

New issue
Copy link
New issue
Copy link
Open
Open
Unsupported private class error doesn't throw on building library for production#17518
Copy link
Labels
area: @schematics/angularfreq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarelyseverity3: brokentype: bug/fix
Milestone
Backlog

Description

@robertIsaac
robertIsaac
opened on Apr 21, 2020
Issue body actions

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

i'm not sure

Description

when i export a component in the library module but not in the public API
the build command throw errors only in normal mode, but in production mode it completes successfully

🔬 Minimal Reproduction

clone https://github.com/robertIsaac/test-library
and run ng b and ng b --prod

or generate from scratch

ng new test-library --create-application=false
cd test-library
ng generate library test-library
ng g c test-export --export
ng b
ng b --prod

🔥 Exception or Error

both commands should throw the following error


Unsupported private class TestExportComponent. This class is visible to consumers via TestLibraryModule -> TestExportComponent, but is not exported from the top-level library entrypoint.

🌍 Your Environment


$ ng version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 9.1.1
Node: 12.14.1
OS: win32 x64

Angular: 9.1.2
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.901.1
@angular-devkit/build-angular      0.901.1
@angular-devkit/build-ng-packagr   0.901.1
@angular-devkit/build-optimizer    0.901.1
@angular-devkit/build-webpack      0.901.1
@angular-devkit/core               9.1.1
@angular-devkit/schematics         9.1.1
@angular/cli                       9.1.1
@ngtools/webpack                   9.1.1
@schematics/angular                9.1.1
@schematics/update                 0.901.1
ng-packagr                         9.1.1
rxjs                               6.5.5
typescript                         3.8.3
webpack                            4.42.0

Anything else relevant?

it would be nice if --export command also update the public api file if it's running inside a library

Reacted by Daniel Kimmich, Hadrien TOMA, nhhockeyplayer and Andrew Cunliffe

Activity

  1. robertIsaac
    changed the title [-]Unsupported private class doesn't throw on building library for production[/-] [+]Unsupported private class error doesn't throw on building library for production[/+] on Apr 21, 2020
  2. alan-agius4
    added
    area: @schematics/angular
    freq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarely
    severity3: broken
    type: bug/fix
    on Apr 21, 2020
  3. ngbot
    modified the milestone: Backlog on Apr 21, 2020
  4. alan-agius4 commented on Apr 21, 2020

    @alan-agius4
    alan-agius4
    on Apr 21, 2020
    Collaborator
    More actions

    @robertIsaac, the problem here is that the above is only an error when using Ivy rendering engine, with View Engine which is used for production builds, this is valid.

    That said, we should add the export to the public api when using the schematics so that we generate valid code for both rendering engines.

    Reacted by robertIsaac, Samarasimhareddy Kommireddy, Daniel Kimmich and nhhockeyplayer
  5. alan-agius4
    added
    severity5: regression
    and removed
    severity3: broken
    on Apr 23, 2020
  6. alan-agius4
    added
    severity3: broken
    and removed
    severity5: regression
    on Jun 12, 2020
  7. SvenBudak commented on Feb 4, 2022

    @SvenBudak
    SvenBudak
    on Feb 4, 2022
    More actions

    Any news?`i sitll have this issue on a new generated project with angular version 13.1.0

    Reacted by Maxime Lyakhov
  8. alan-agius4 commented on Jul 4, 2022

    @alan-agius4
    alan-agius4
    on Jul 4, 2022 · Hidden as off-topic
    show commentMore actions
  9. SvenBudak commented on Jul 4, 2022

    @SvenBudak
    SvenBudak
    on Jul 4, 2022 · Hidden as off-topic
    show commentMore actions
  10. alan-agius4 commented on Jul 4, 2022

    @alan-agius4
    alan-agius4
    on Jul 4, 2022 · Hidden as spam
    show commentMore actions
  11. Amit221060 commented on Oct 6, 2023

    @Amit221060
    Amit221060
    on Oct 6, 2023
    More actions

    Do we need to add all exports in public.api.ts or any other work around after angular 12.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: @schematics/angularfreq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarelyseverity3: brokentype: bug/fix

    Type

    No type

    Projects

    No projects

      Milestone

      • BacklogNo due date

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.