Angular 18 app run-time error: Uncaught TypeError: (intermediate value).webpackContext is not...

Discussão em 'Angular' iniciado por Adventitious Angles Qs, Setembro 9, 2024.

  1. Trying to upgrade angular from 16 to 18 in a webapp project. In package.json, packaged related to webpack are:

    "@ngtools/webpack": "^18.2.3", "@types/webpack": "^5.28.5", "webpack": "^5.94.0"

    After finishing grading to Angular 18, building is good but met with a run-time error:

    Uncaught TypeError: (intermediate value).webpackContext is not a function

    The corresponding code is:

    const context = (import.meta as any).webpackContext(
    '../../plugin/dist',
    { recursive: true, regExp: /\.(?:eek:gg|mp3|swf)$/, mode: 'lazy' }
    );


    I tried to resolve this issue but in vain. Any advice for help? Thanks!

    Continue reading...

Compartilhe esta Página