Skip to content

[BUG] when publishing as a npm package usage gives errors #20476

Closed

Description

@Juoper

i generate my client using this command:

generate -i src/main/resources/openapi.yml -g typescript-angular -o generated-client -p apiModulePrefix=${APPLICATION_NAME#*-} -p configurationPrefix=${APPLICATION_NAME#*-} -p npmName=@mmos/$APPLICATION_NAME -p npmRepository=https://${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/ -p ngVersion=17.3.4 -p npmVersion=$COMBINED_VAR - cat generated-client/package.json

when i add it as a npm dependency and try to run ng serve i get the followig error
An unhandled exception occurred: Failed to resolve entry for package "@mmos/mmos-jobcenterservice". The package may have incorrect main/module/exports specified in its package.json.

this is my tsconfig.json:
/* To learn more about this file see: https://angular.io/config/tsconfig. */ { "compileOnSave": true, "compilerOptions": { "baseUrl": "./src", "outDir": "./dist/out-tsc", "paths": { "@shared/*": ["app/shared/*"], "@modules/*": ["app/modules/*"], "@core/*": ["app/core/*"], }, "forceConsistentCasingInFileNames": true, "esModuleInterop": true, "strict": false, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, "sourceMap": true, "declaration": false, "experimentalDecorators": true, "moduleResolution": "node", "importHelpers": true, "skipLibCheck": true, "useDefineForClassFields": false }, "angularCompilerOptions": { "enableI18nLegacyMessageIdFormat": false, "strictInjectionParameters": true, "strictInputAccessModifiers": true, "strictTemplates": true } }
and this my tsconfig.app.json:

/* To learn more about this file see: https://angular.io/config/tsconfig. */ { "extends": "./tsconfig.json", "compilerOptions": { "outDir": "./out-tsc/app", "types": [] }, "files": ["src/main.ts", "src/polyfills.ts"], "include": ["src/**/*.d.ts", "node_modules/@mmos/mmos-jobcenterservice/**/*.ts"] }

Activity

  1. Juoper commented on Mar 3, 2025

    @Juoper
    Author

    you actually have to build it before publishing

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions