Skip to content

Publishing error with Node 22.X: Unable to resolve collection "publishers": Error: Unable to resolve collection "htmlPagePublisherPlugins" #2811

@Ausxor

Description

@Ausxor

Bug description

When running:

npm run publish

On a fresh checkout of version '2.33.0' of the portal, the following error is received:

safe-buffer (ignored) 15 bytes [built] [code generated]
webpack 5.88.2 compiled successfully in 88853 ms
webpack://apim-developer-portal/./node_modules/@paperbits/common/injection/inversifyInjector.ts?:124
                    throw new Error(`Unable to resolve collection "${collectionName}": ${error.stack || error.message}`);
                    ^

Error: Unable to resolve collection "publishers": Error: Unable to resolve collection "htmlPagePublisherPlugins": TypeError: Cannot set property navigator of #<Object> which has only a getter
    at KnockoutHtmlPagePublisherPlugin.initialize (webpack://apim-developer-portal/./node_modules/@paperbits/core/publishing/knockoutHtmlPagePublisherPlugin.ts?:29:26)
    at new KnockoutHtmlPagePublisherPlugin (webpack://apim-developer-portal/./node_modules/@paperbits/core/publishing/knockoutHtmlPagePublisherPlugin.ts?:20:14)
    at _createInstance (webpack://apim-developer-portal/./node_modules/inversify/lib/resolution/instantiation.js?:27:12)
    at Object.resolveInstance (webpack://apim-developer-portal/./node_modules/inversify/lib/resolution/instantiation.js?:47:18)
    at eval (webpack://apim-developer-portal/./node_modules/inversify/lib/resolution/resolver.js?:75:42)
    at eval (webpack://apim-developer-portal/./node_modules/inversify/lib/resolution/resolver.js?:35:24)
    at Array.map (<anonymous>)
    at eval (webpack://apim-developer-portal/./node_modules/inversify/lib/resolution/resolver.js?:33:34)
    at Object.resolve (webpack://apim-developer-portal/./node_modules/inversify/lib/resolution/resolver.js?:99:12)
    at eval (webpack://apim-developer-portal/./node_modules/inversify/lib/container/container.js?:335:37)
    at new Collection (webpack://apim-developer-portal/./node_modules/@paperbits/common/injection/inversifyInjector.ts?:124:27)
    at Object.resolveInstance (webpack://apim-developer-portal/./node_modules/inversify/lib/resolution/instantiation.js?:51:18)
    at eval (webpack://apim-developer-portal/./node_modules/inversify/lib/resolution/resolver.js?:75:42)
    at Array.map (<anonymous>)
    at Object.resolveInstance (webpack://apim-developer-portal/./node_modules/inversify/lib/resolution/instantiation.js?:46:67)
    at eval (webpack://apim-developer-portal/./node_modules/inversify/lib/resolution/resolver.js?:75:42)
    at Array.map (<anonymous>)
    at Object.resolveInstance (webpack://apim-developer-portal/./node_modules/inversify/lib/resolution/instantiation.js?:46:67)
    at eval (webpack://apim-developer-portal/./node_modules/inversify/lib/resolution/resolver.js?:75:42)
    at eval (webpack://apim-developer-portal/./node_modules/inversify/lib/resolution/resolver.js?:35:24)
    at new Collection (webpack://apim-developer-portal/./node_modules/@paperbits/common/injection/inversifyInjector.ts?:124:27)
    at Object.resolveInstance (webpack://apim-developer-portal/./node_modules/inversify/lib/resolution/instantiation.js?:51:18)
    at eval (webpack://apim-developer-portal/./node_modules/inversify/lib/resolution/resolver.js?:75:42)
    at Array.map (<anonymous>)
    at Object.resolveInstance (webpack://apim-developer-portal/./node_modules/inversify/lib/resolution/instantiation.js?:46:67)
    at eval (webpack://apim-developer-portal/./node_modules/inversify/lib/resolution/resolver.js?:75:42)
    at Object.resolve (webpack://apim-developer-portal/./node_modules/inversify/lib/resolution/resolver.js?:99:12)
    at eval (webpack://apim-developer-portal/./node_modules/inversify/lib/container/container.js?:335:37)
    at Container._get (webpack://apim-developer-portal/./node_modules/inversify/lib/container/container.js?:326:44)
    at Container.get (webpack://apim-developer-portal/./node_modules/inversify/lib/container/container.js?:243:21)

This only occurs in Node 22.X ( I have confirmed this issue on 20.19.1, 22.14.0, and 22.15.0). I have tested in Node 20.19.1, and the issue is not present.

Reproduction steps

  1. Ensure you are using a version of Node >=22.X
  2. Checkout release 2.33.0 of the self hosted portal and make necessary config file changes.
  3. Run 'npm run publish'.
  4. Observe error displayed above.

Expected behaviour

Compilation succeeds and portal loads in browser.

Is self-hosted portal?

Yes

Release tag or commit SHA (if using self-hosted version)

2.33.0

API Management service name

not disclosed

Environment

  • Operating system: 11
  • Browser: Edge
  • Version: 136.0.3240.64

Additional context

This issue is raised by CSS support. This issue can be replicated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions