Giter Club home page Giter Club logo

Comments (9)

ducin avatar ducin commented on May 11, 2024 2

hey I did the repo first https://github.com/ducin/angular-issue-not-exported-class 😅

from angular-cli.

alan-agius4 avatar alan-agius4 commented on May 11, 2024 1

Closed via angular/angular#54309

from angular-cli.

JeanMeche avatar JeanMeche commented on May 11, 2024

Seems like there was a related issue on the FW repo : angular/angular#53678

There framework throwing an error is one thing, but it should thrown correctly by the application builder.

from angular-cli.

alan-agius4 avatar alan-agius4 commented on May 11, 2024

This is a bug in the compiler as calling compilation.diagnoseFiles() is retuning undefined which should never happen.

from angular-cli.

alxhub avatar alxhub commented on May 11, 2024

@alan-agius4 which compilation is that? I don't think we have a diagnoseFiles function anywhere in ngc.

from angular-cli.

alan-agius4 avatar alan-agius4 commented on May 11, 2024

@alxhub, apologies, I did not initial realize that it's an Angular CLI implementation.

from angular-cli.

alan-agius4 avatar alan-agius4 commented on May 11, 2024

This is similar to : angular/angular#53678 where the compiler is throwing a FatalDiagnosticError on the typecheck file. Now since this is not an instance of Error the Piscina will assume that an error did not occur and will not exit successfully and not with an error.

FatalDiagnosticError {
  code: 3004,
  node: <ref *1> SourceFileObject {
    pos: 0,
    end: 0,
    flags: 0,
    modifierFlagsCache: 0,
    transformFlags: 0,
    parent: undefined,
    kind: 312,
    statements: [ pos: 0, end: 0, hasTrailingComma: false, transformFlags: 0 ],
    endOfFileToken: TokenObject {
      pos: 0,
      end: 0,
      flags: 0,
      modifierFlagsCache: 0,
      transformFlags: 0,
      parent: [Circular *1],
      kind: 1
    },
    text: '',
    fileName: '/next/src/main.ngtypecheck.ts',
    path: '',
    resolvedPath: '',
    originalFileName: '',
    languageVersion: 99,
    languageVariant: 0,
    scriptKind: 3,
    isDeclarationFile: false,
    hasNoDefaultLib: false,
    locals: undefined,
    nextContainer: undefined,
    endFlowNode: undefined,
    nodeCount: 2,
    identifierCount: 0,
    symbolCount: 0,
    parseDiagnostics: [],
    bindDiagnostics: [],
    bindSuggestionDiagnostics: undefined,
    lineMap: undefined,
    externalModuleIndicator: undefined,
    setExternalModuleIndicator: [Function: setExternalModuleIndicator],
    pragmas: Map(0) {},
    checkJsDirective: undefined,
    referencedFiles: [],
    typeReferenceDirectives: [],
    libReferenceDirectives: [],
    amdDependencies: [],
    commentDirectives: undefined,
    identifiers: Map(0) {},
    packageJsonLocations: undefined,
    packageJsonScope: undefined,
    imports: undefined,
    moduleAugmentations: undefined,
    ambientModuleNames: undefined,
    classifiableNames: undefined,
    impliedNodeFormat: undefined,
    jsDocParsingMode: 0,
    [Symbol(AbsolutePath)]: '/next/src/main.ngtypecheck.ts'
  },
  message: {
    category: 3,
    code: 0,
    messageText: 'Unable to import symbol Child.',
    next: [ [Object] ]
  },
  relatedInformation: [
    {
      category: 3,
      code: 0,
      file: [SourceFileObject],
      start: 117,
      length: 130,
      messageText: 'The symbol is declared here.'
    }
  ],
  _isFatalDiagnosticError: true
}

From my understanding the Angular compiler should never surface a FatalDiagnosticError, and it should be transformed to a diagnostics internally. Is this correct @alxhub / @JoostK? As otherwise, we'd need to expose FatalDiagnosticError and isFatalDiagnosticError APIs from the Compiler and make them accessable to the Angular CLI.

So in my eyes there are 2 problems here:

  1. The error points to a typecheck file
  2. The check in https://github.com/angular/angular/blob/f39cb064183d984254bdf4e41b61d3dc9379738a/packages/compiler-cli/src/ngtsc/core/src/compiler.ts#L457-L461 should be changed so that if it's a FatalDiagnosticError it is not thrown.

//cc @devversion, who modified the above code recently in angular/angular@760b1f3

from angular-cli.

devversion avatar devversion commented on May 11, 2024

Yeah, so to clarify: Before my "fix", we did not catch fatal diagnostics at all when collecting extended diagnostics. This surfaced these super hard to debug errors when e.g. a class was not exported and the TCB code couldn't be generated at all- the same is used for extended diagnostics.

It looks like as part of my fix, I did forget returning early and therefore diagnostics are converted properly now (before they weren't)- but we are still throwing. So my fix was a noop. I'm sending a fix- but the root causes are still:

  • Need to fix that we are not throwing- like I was attempting to do with my PR
  • CLI should be improved to not swallow runtime exceptions error. It was non-trivial to debug this back then

from angular-cli.

alan-agius4 avatar alan-agius4 commented on May 11, 2024

The error is being swallowed as FatalDiagnosticError is not Error which causes the worker to exit without an error. See check in piscinajs. As per convo with @devversion, he will try to make these as errors.

from angular-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.