Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: __webpack_require__.O is not a function after upgrading to a version >=4.24.0 #8143

Open
nocive opened this issue Dec 14, 2023 · 8 comments

Comments

@nocive
Copy link

nocive commented Dec 14, 2023

Environment

Sonata packages

show

$ composer show --latest 'sonata-project/*'
Direct dependencies required in composer.json:
sonata-project/admin-bundle              4.29.1 4.29.1 The missing Symfony Admin Generator
sonata-project/doctrine-orm-admin-bundle 4.15.0 4.15.0 Integrate Doctrine ORM into the SonataAdminBundle
sonata-project/entity-audit-bundle       1.16.0 1.16.0 Audit for Doctrine Entities
sonata-project/exporter                  2.14.0 3.3.0  Lightweight Exporter library
sonata-project/intl-bundle               2.14.1 3.2.0  Symfony SonataIntlBundle

Transitive dependencies not required in composer.json:
sonata-project/block-bundle              5.1.0  5.1.0  Symfony SonataBlockBundle
sonata-project/doctrine-extensions       2.3.0  2.3.0  Doctrine2 behavioral extensions
sonata-project/form-extensions           2.3.0  2.3.0  Symfony form extensions
sonata-project/twig-extensions           2.4.0  2.4.0  Sonata twig extensions

Symfony packages

show

$ composer show --latest 'symfony/*'
Direct dependencies required in composer.json:
symfony/asset                      v5.4.31 v7.0.0  Manages URL generation and versioning of web assets such as CSS stylesheets, JavaScript files and image files
symfony/browser-kit                v5.4.31 v7.0.0  Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms programmatically
symfony/css-selector               v5.4.26 v7.0.0  Converts CSS selectors to XPath expressions
symfony/debug-bundle               v5.4.26 v7.0.0  Provides a tight integration of the Symfony VarDumper component and the ServerLogCommand from MonologBridge into the Symfony full-stack framework
symfony/dotenv                     v5.4.30 v7.0.0  Registers environment variables from a .env file
symfony/flex                       v2.4.2  v2.4.2  Composer plugin for Symfony
symfony/framework-bundle           v5.4.32 v7.0.1  Provides a tight integration between Symfony components and the Symfony full-stack framework
symfony/http-client                v5.4.31 v7.0.0  Provides powerful methods to fetch HTTP resources synchronously or asynchronously
symfony/lock                       v5.4.32 v7.0.0  Creates and manages locks, a mechanism to provide exclusive access to a shared resource
symfony/mailer                     v5.4.31 v7.0.0  Helps sending emails
symfony/maker-bundle               v1.50.0 v1.52.0 Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.
symfony/mime                       v5.4.26 v7.0.0  Allows manipulating MIME messages
symfony/monolog-bundle             v3.10.0 v3.10.0 Symfony MonologBundle
symfony/phpunit-bridge             v5.4.33 v7.0.1  Provides utilities for PHPUnit, especially user deprecation notices management
symfony/proxy-manager-bridge       v5.4.21 v6.4.0  Provides integration for ProxyManager with various Symfony components
symfony/serializer                 v5.4.33 v7.0.1  Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.
symfony/stopwatch                  v5.4.21 v7.0.0  Provides a way to profile code
symfony/web-profiler-bundle        v5.4.31 v7.0.0  Provides a development tool that gives detailed information about the execution of any request
symfony/webpack-encore-bundle      v2.1.1  v2.1.1  Integration with your Symfony app & Webpack Encore!
symfony/yaml                       v5.4.31 v7.0.0  Loads and dumps YAML files

Transitive dependencies not required in composer.json:
symfony/cache                      v5.4.32 v7.0.0  Provides extended PSR-6, PSR-16 (and tags) implementations
symfony/cache-contracts            v2.5.2  v3.4.0  Generic abstractions related to caching
symfony/config                     v5.4.31 v7.0.0  Helps you find, load, combine, autofill and validate configuration values of any kind
symfony/console                    v5.4.32 v7.0.1  Eases the creation of beautiful and testable command line interfaces
symfony/dependency-injection       v5.4.33 v7.0.1  Allows you to standardize and centralize the way objects are constructed in your application
symfony/deprecation-contracts      v3.4.0  v3.4.0  A generic function and convention to trigger deprecation notices
symfony/doctrine-bridge            v5.4.31 v7.0.0  Provides integration for Doctrine with various Symfony components
symfony/dom-crawler                v5.4.32 v7.0.0  Eases DOM navigation for HTML and XML documents
symfony/error-handler              v5.4.29 v7.0.0  Provides tools to manage errors and ease debugging PHP code
symfony/event-dispatcher           v5.4.26 v7.0.0  Provides tools that allow your application components to communicate with each other by dispatching events and listening to them
symfony/event-dispatcher-contracts v3.4.0  v3.4.0  Generic abstractions related to dispatching event
symfony/expression-language        v5.4.21 v7.0.0  Provides an engine that can compile and evaluate expressions
symfony/filesystem                 v5.4.25 v7.0.0  Provides basic utilities for the filesystem
symfony/finder                     v5.4.27 v7.0.0  Finds files and directories via an intuitive fluent interface
symfony/form                       v5.4.33 v7.0.1  Allows to easily create, process and reuse HTML forms
symfony/http-client-contracts      v2.5.2  v3.4.0  Generic abstractions related to HTTP clients
symfony/http-foundation            v5.4.32 v7.0.0  Defines an object-oriented layer for the HTTP specification
symfony/http-kernel                v5.4.33 v7.0.1  Provides a structured process for converting a Request into a Response
symfony/intl                       v5.4.30 v7.0.0  Provides a PHP replacement layer for the C intl extension that includes additional data from the ICU library
symfony/monolog-bridge             v5.4.31 v7.0.0  Provides integration for Monolog with various Symfony components
symfony/options-resolver           v5.4.21 v7.0.0  Provides an improved replacement for the array_replace PHP function
symfony/password-hasher            v5.4.31 v7.0.0  Provides password hashing utilities
symfony/polyfill-ctype             v1.28.0 v1.28.0 Symfony polyfill for ctype functions
symfony/polyfill-intl-grapheme     v1.28.0 v1.28.0 Symfony polyfill for intl's grapheme_* functions
symfony/polyfill-intl-icu          v1.28.0 v1.28.0 Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-intl-idn          v1.28.0 v1.28.0 Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions
symfony/polyfill-intl-normalizer   v1.28.0 v1.28.0 Symfony polyfill for intl's Normalizer class and related functions
symfony/polyfill-mbstring          v1.28.0 v1.28.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php72             v1.28.0 v1.28.0 Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions
symfony/polyfill-php73             v1.28.0 v1.28.0 Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions
symfony/polyfill-php80             v1.28.0 v1.28.0 Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
symfony/polyfill-php81             v1.28.0 v1.28.0 Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions
symfony/process                    v5.4.28 v7.0.0  Executes commands in sub-processes
symfony/property-access            v5.4.26 v7.0.0  Provides functions to read and write from/to an object or array using a simple string notation
symfony/property-info              v5.4.24 v7.0.0  Extracts information about PHP class' properties using metadata of popular sources
symfony/psr-http-message-bridge    v2.3.1  v7.0.0  PSR HTTP message bridge
symfony/routing                    v5.4.33 v7.0.1  Maps an HTTP request to a set of configuration variables
symfony/security-acl               v3.3.3  v3.3.3  Symfony Security Component - ACL (Access Control List)
symfony/security-bundle            v5.4.31 v7.0.0  Provides a tight integration of the Security component into the Symfony full-stack framework
symfony/security-core              v5.4.30 v7.0.1  Symfony Security Component - Core Library
symfony/security-csrf              v5.4.27 v7.0.1  Symfony Security Component - CSRF Library
symfony/security-guard             v5.4.27 v5.4.27 Symfony Security Component - Guard
symfony/security-http              v5.4.31 v7.0.1  Symfony Security Component - HTTP Integration
symfony/service-contracts          v2.5.2  v3.4.0  Generic abstractions related to writing services
symfony/string                     v5.4.32 v7.0.0  Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way
symfony/translation                v5.4.31 v7.0.0  Provides tools to internationalize your application
symfony/translation-contracts      v2.5.2  v3.4.0  Generic abstractions related to translation
symfony/twig-bridge                v5.4.31 v7.0.0  Provides integration for Twig with various Symfony components
symfony/twig-bundle                v5.4.31 v7.0.0  Provides a tight integration of Twig into the Symfony full-stack framework
symfony/validator                  v5.4.32 v7.0.0  Provides tools to validate values
symfony/var-dumper                 v5.4.29 v7.0.0  Provides mechanisms for walking through any arbitrary PHP variable
symfony/var-exporter               v6.4.1  v7.0.1  Allows exporting any serializable PHP data structure to plain PHP code

npm packages

show
$ yarn info -R --name-only
├─ @ampproject/remapping@npm:2.2.1
├─ @babel/code-frame@npm:7.23.5
├─ @babel/compat-data@npm:7.23.5
├─ @babel/core@npm:7.23.6
├─ @babel/generator@npm:7.23.6
├─ @babel/helper-annotate-as-pure@npm:7.22.5
├─ @babel/helper-builder-binary-assignment-operator-visitor@npm:7.22.15
├─ @babel/helper-compilation-targets@npm:7.23.6
├─ @babel/helper-create-class-features-plugin@npm:7.23.6
├─ @babel/helper-create-regexp-features-plugin@npm:7.22.15
├─ @babel/helper-define-polyfill-provider@npm:0.4.3
├─ @babel/helper-environment-visitor@npm:7.22.20
├─ @babel/helper-function-name@npm:7.23.0
├─ @babel/helper-hoist-variables@npm:7.22.5
├─ @babel/helper-member-expression-to-functions@npm:7.23.0
├─ @babel/helper-module-imports@npm:7.22.15
├─ @babel/helper-module-transforms@npm:7.23.3
├─ @babel/helper-optimise-call-expression@npm:7.22.5
├─ @babel/helper-plugin-utils@npm:7.22.5
├─ @babel/helper-remap-async-to-generator@npm:7.22.20
├─ @babel/helper-replace-supers@npm:7.22.20
├─ @babel/helper-simple-access@npm:7.22.5
├─ @babel/helper-skip-transparent-expression-wrappers@npm:7.22.5
├─ @babel/helper-split-export-declaration@npm:7.22.6
├─ @babel/helper-string-parser@npm:7.23.4
├─ @babel/helper-validator-identifier@npm:7.22.20
├─ @babel/helper-validator-option@npm:7.23.5
├─ @babel/helper-wrap-function@npm:7.22.20
├─ @babel/helpers@npm:7.23.6
├─ @babel/highlight@npm:7.23.4
├─ @babel/parser@npm:7.23.6
├─ @babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:7.23.3
├─ @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:7.23.3
├─ @babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@npm:7.23.3
├─ @babel/plugin-proposal-class-properties@npm:7.18.6
├─ @babel/plugin-proposal-private-property-in-object@npm:7.21.0-placeholder-for-preset-env.2
├─ @babel/plugin-syntax-async-generators@npm:7.8.4
├─ @babel/plugin-syntax-class-properties@npm:7.12.13
├─ @babel/plugin-syntax-class-static-block@npm:7.14.5
├─ @babel/plugin-syntax-dynamic-import@npm:7.8.3
├─ @babel/plugin-syntax-export-namespace-from@npm:7.8.3
├─ @babel/plugin-syntax-import-assertions@npm:7.23.3
├─ @babel/plugin-syntax-import-attributes@npm:7.23.3
├─ @babel/plugin-syntax-import-meta@npm:7.10.4
├─ @babel/plugin-syntax-json-strings@npm:7.8.3
├─ @babel/plugin-syntax-logical-assignment-operators@npm:7.10.4
├─ @babel/plugin-syntax-nullish-coalescing-operator@npm:7.8.3
├─ @babel/plugin-syntax-numeric-separator@npm:7.10.4
├─ @babel/plugin-syntax-object-rest-spread@npm:7.8.3
├─ @babel/plugin-syntax-optional-catch-binding@npm:7.8.3
├─ @babel/plugin-syntax-optional-chaining@npm:7.8.3
├─ @babel/plugin-synt<details>ax-private-property-in-object@npm:7.14.5
├─ @babel/plugin-syntax-top-level-await@npm:7.14.5
├─ @babel/plugin-syntax-unicode-sets-regex@npm:7.18.6
├─ @babel/plugin-transform-arrow-functions@npm:7.23.3
├─ @babel/plugin-transform-async-generator-functions@npm:7.23.4
├─ @babel/plugin-transform-async-to-generator@npm:7.23.3
├─ @babel/plugin-transform-block-scoped-functions@npm:7.23.3
├─ @babel/plugin-transform-block-scoping@npm:7.23.4
├─ @babel/plugin-transform-class-properties@npm:7.23.3
├─ @babel/plugin-transform-class-static-block@npm:7.23.4
├─ @babel/plugin-transform-classes@npm:7.23.5
├─ @babel/plugin-transform-computed-properties@npm:7.23.3
├─ @babel/plugin-transform-destructuring@npm:7.23.3
├─ @babel/plugin-transform-dotall-regex@npm:7.23.3
├─ @babel/plugin-transform-duplicate-keys@npm:7.23.3
├─ @babel/plugin-transform-dynamic-import@npm:7.23.4
├─ @babel/plugin-transform-exponentiation-operator@npm:7.23.3
├─ @babel/plugin-transform-export-namespace-from@npm:7.23.4
├─ @babel/plugin-transform-for-of@npm:7.23.6
├─ @babel/plugin-transform-function-name@npm:7.23.3
├─ @babel/plugin-transform-json-strings@npm:7.23.4
├─ @babel/plugin-transform-literals@npm:7.23.3
├─ @babel/plugin-transform-logical-assignment-operators@npm:7.23.4
├─ @babel/plugin-transform-member-expression-literals@npm:7.23.3
├─ @babel/plugin-transform-modules-amd@npm:7.23.3
├─ @babel/plugin-transform-modules-commonjs@npm:7.23.3
├─ @babel/plugin-transform-modules-systemjs@npm:7.23.3
├─ @babel/plugin-transform-modules-umd@npm:7.23.3
├─ @babel/plugin-transform-named-capturing-groups-regex@npm:7.22.5
├─ @babel/plugin-transform-new-target@npm:7.23.3
├─ @babel/plugin-transform-nullish-coalescing-operator@npm:7.23.4
├─ @babel/plugin-transform-numeric-separator@npm:7.23.4
├─ @babel/plugin-transform-object-rest-spread@npm:7.23.4
├─ @babel/plugin-transform-object-super@npm:7.23.3
├─ @babel/plugin-transform-optional-catch-binding@npm:7.23.4
├─ @babel/plugin-transform-optional-chaining@npm:7.23.4
├─ @babel/plugin-transform-parameters@npm:7.23.3
├─ @babel/plugin-transform-private-methods@npm:7.23.3
├─ @babel/plugin-transform-private-property-in-object@npm:7.23.4
├─ @babel/plugin-transform-property-literals@npm:7.23.3
├─ @babel/plugin-transform-regenerator@npm:7.23.3
├─ @babel/plugin-transform-reserved-words@npm:7.23.3
├─ @babel/plugin-transform-shorthand-properties@npm:7.23.3
├─ @babel/plugin-transform-spread@npm:7.23.3
├─ @babel/plugin-transform-sticky-regex@npm:7.23.3
├─ @babel/plugin-transform-template-literals@npm:7.23.3
├─ @babel/plugin-transform-typeof-symbol@npm:7.23.3
├─ @babel/plugin-transform-unicode-escapes@npm:7.23.3
├─ @babel/plugin-transform-unicode-property-regex@npm:7.23.3
├─ @babel/plugin-transform-unicode-regex@npm:7.23.3
├─ @babel/plugin-transform-unicode-sets-regex@npm:7.23.3
├─ @babel/preset-env@npm:7.23.6
├─ @babel/preset-modules@npm:0.1.6-no-external-plugins
├─ @babel/regjsgen@npm:0.8.0
├─ @babel/runtime@npm:7.23.2
├─ @babel/template@npm:7.22.15
├─ @babel/traverse@npm:7.23.2
├─ @babel/types@npm:7.23.6
├─ @discoveryjs/json-ext@npm:0.5.7
├─ @isaacs/cliui@npm:8.0.2
├─ @jest/schemas@npm:29.6.3
├─ @jest/types@npm:29.6.3
├─ @jridgewell/gen-mapping@npm:0.3.3
├─ @jridgewell/resolve-uri@npm:3.1.1
├─ @jridgewell/set-array@npm:1.1.2
├─ @jridgewell/source-map@npm:0.3.5
├─ @jridgewell/sourcemap-codec@npm:1.4.15
├─ @jridgewell/trace-mapping@npm:0.3.20
├─ @leichtgewicht/ip-codec@npm:2.0.4
├─ @npmcli/fs@npm:3.1.0
├─ @nuxt/friendly-errors-webpack-plugin@npm:2.5.2
├─ @pkgjs/parseargs@npm:0.11.0
├─ @sentry-internal/feedback@npm:7.86.0
├─ @sentry-internal/tracing@npm:7.86.0
├─ @sentry/browser@npm:7.86.0
├─ @sentry/core@npm:7.86.0
├─ @sentry/replay@npm:7.86.0
├─ @sentry/types@npm:7.86.0
├─ @sentry/utils@npm:7.86.0
├─ @sinclair/typebox@npm:0.27.8
├─ @symfony/webpack-encore@npm:4.5.0
├─ @tootallnate/once@npm:2.0.0
├─ @trysound/sax@npm:0.2.0
├─ @types/body-parser@npm:1.19.4
├─ @types/bonjour@npm:3.5.12
├─ @types/connect-history-api-fallback@npm:1.5.2
├─ @types/connect@npm:3.4.37
├─ @types/eslint-scope@npm:3.7.6
├─ @types/eslint@npm:8.44.6
├─ @types/estree@npm:1.0.3
├─ @types/express-serve-static-core@npm:4.17.39
├─ @types/express@npm:4.17.20
├─ @types/glob@npm:7.2.0
├─ @types/html-minifier-terser@npm:6.1.0
├─ @types/http-errors@npm:2.0.3
├─ @types/http-proxy@npm:1.17.13
├─ @types/istanbul-lib-coverage@npm:2.0.5
├─ @types/istanbul-lib-report@npm:3.0.2
├─ @types/istanbul-reports@npm:3.0.3
├─ @types/json-schema@npm:7.0.14
├─ @types/mime@npm:1.3.4
├─ @types/mime@npm:3.0.3
├─ @types/minimatch@npm:5.1.2
├─ @types/node-forge@npm:1.3.8
├─ @types/node@npm:20.8.9
├─ @types/qs@npm:6.9.9
├─ @types/range-parser@npm:1.2.6
├─ @types/retry@npm:0.12.0
├─ @types/send@npm:0.17.3
├─ @types/serve-index@npm:1.9.3
├─ @types/serve-static@npm:1.15.4
├─ @types/sockjs@npm:0.3.35
├─ @types/ws@npm:8.5.8
├─ @types/yargs-parser@npm:21.0.2
├─ @types/yargs@npm:17.0.29
├─ @webassemblyjs/ast@npm:1.11.6
├─ @webassemblyjs/floating-point-hex-parser@npm:1.11.6
├─ @webassemblyjs/helper-api-error@npm:1.11.6
├─ @webassemblyjs/helper-buffer@npm:1.11.6
├─ @webassemblyjs/helper-numbers@npm:1.11.6
├─ @webassemblyjs/helper-wasm-bytecode@npm:1.11.6
├─ @webassemblyjs/helper-wasm-section@npm:1.11.6
├─ @webassemblyjs/ieee754@npm:1.11.6
├─ @webassemblyjs/leb128@npm:1.11.6
├─ @webassemblyjs/utf8@npm:1.11.6
├─ @webassemblyjs/wasm-edit@npm:1.11.6
├─ @webassemblyjs/wasm-gen@npm:1.11.6
├─ @webassemblyjs/wasm-opt@npm:1.11.6
├─ @webassemblyjs/wasm-parser@npm:1.11.6
├─ @webassemblyjs/wast-printer@npm:1.11.6
├─ @webpack-cli/configtest@npm:2.1.1
├─ @webpack-cli/info@npm:2.0.2
├─ @webpack-cli/serve@npm:2.0.5
├─ @xtuc/ieee754@npm:1.2.0
├─ @xtuc/long@npm:4.2.2
├─ abbrev@npm:1.1.1
├─ accepts@npm:1.3.8
├─ acorn-import-assertions@npm:1.9.0
├─ acorn@npm:8.11.1
├─ adjust-sourcemap-loader@npm:4.0.0
├─ agent-base@npm:6.0.2
├─ agentkeepalive@npm:4.5.0
├─ aggregate-error@npm:3.1.0
├─ ajv-formats@npm:2.1.1
├─ ajv-keywords@npm:3.5.2
├─ ajv-keywords@npm:5.1.0
├─ ajv@npm:6.12.6
├─ ajv@npm:8.12.0
├─ ansi-html-community@npm:0.0.8
├─ ansi-regex@npm:5.0.1
├─ ansi-regex@npm:6.0.1
├─ ansi-styles@npm:3.2.1
├─ ansi-styles@npm:4.3.0
├─ ansi-styles@npm:6.2.1
├─ anymatch@npm:3.1.3
├─ aproba@npm:2.0.0
├─ are-we-there-yet@npm:3.0.1
├─ array-flatten@npm:1.1.1
├─ array-flatten@npm:2.1.2
├─ array-union@npm:1.0.2
├─ array-uniq@npm:1.0.3
├─ assets-webpack-plugin@npm:7.0.0
├─ babel-loader@npm:9.1.3
├─ babel-plugin-polyfill-corejs2@npm:0.4.6
├─ babel-plugin-polyfill-corejs3@npm:0.8.6
├─ babel-plugin-polyfill-regenerator@npm:0.5.3
├─ balanced-match@npm:1.0.2
├─ batch@npm:0.6.1
├─ big.js@npm:5.2.2
├─ binary-extensions@npm:2.2.0
├─ body-parser@npm:1.20.1
├─ bonjour-service@npm:1.1.1
├─ boolbase@npm:1.0.0
├─ bootstrap-select@npm:1.13.18
├─ bootstrap@npm:3.4.1
├─ brace-expansion@npm:1.1.11
├─ brace-expansion@npm:2.0.1
├─ braces@npm:3.0.2
├─ browserslist@npm:4.22.2
├─ buffer-from@npm:1.1.2
├─ bytes@npm:3.0.0
├─ bytes@npm:3.1.2
├─ cacache@npm:17.1.4
├─ call-bind@npm:1.0.5
├─ camel-case@npm:4.1.2
├─ camelcase@npm:6.3.0
├─ caniuse-api@npm:3.0.0
├─ caniuse-lite@npm:1.0.30001568
├─ chalk@npm:2.4.2
├─ chalk@npm:4.1.2
├─ chokidar@npm:3.5.3
├─ chownr@npm:2.0.0
├─ chrome-trace-event@npm:1.0.3
├─ ci-info@npm:3.9.0
├─ clean-css@npm:5.3.2
├─ clean-stack@npm:2.2.0
├─ clean-webpack-plugin@npm:4.0.0
├─ clone-deep@npm:4.0.1
├─ color-convert@npm:1.9.3
├─ color-convert@npm:2.0.1
├─ color-name@npm:1.1.3
├─ color-name@npm:1.1.4
├─ color-support@npm:1.1.3
├─ colord@npm:2.9.3
├─ colorette@npm:2.0.20
├─ commander@npm:10.0.1
├─ commander@npm:2.20.3
├─ commander@npm:7.2.0
├─ commander@npm:8.3.0
├─ common-path-prefix@npm:3.0.0
├─ compressible@npm:2.0.18
├─ compression@npm:1.7.4
├─ concat-map@npm:0.0.1
├─ connect-history-api-fallback@npm:2.0.0
├─ consola@npm:2.15.3
├─ console-control-strings@npm:1.1.0
├─ content-disposition@npm:0.5.4
├─ content-type@npm:1.0.5
├─ convert-source-map@npm:1.9.0
├─ convert-source-map@npm:2.0.0
├─ cookie-signature@npm:1.0.6
├─ cookie@npm:0.5.0
├─ core-js-compat@npm:3.33.1
├─ core-js@npm:3.34.0
├─ core-util-is@npm:1.0.3
├─ cross-spawn@npm:7.0.3
├─ css-declaration-sorter@npm:6.4.1
├─ css-loader@npm:6.8.1
├─ css-minimizer-webpack-plugin@npm:5.0.1
├─ css-select@npm:4.3.0
├─ css-select@npm:5.1.0
├─ css-tree@npm:2.2.1
├─ css-tree@npm:2.3.1
├─ css-what@npm:6.1.0
├─ cssesc@npm:3.0.0
├─ cssnano-preset-default@npm:6.0.1
├─ cssnano-utils@npm:4.0.0
├─ cssnano@npm:6.0.1
├─ csso@npm:5.0.5
├─ debug@npm:2.6.9
├─ debug@npm:4.3.4
├─ default-gateway@npm:6.0.3
├─ define-data-property@npm:1.1.1
├─ define-lazy-prop@npm:2.0.0
├─ del@npm:4.1.1
├─ delegates@npm:1.0.0
├─ depd@npm:1.1.2
├─ depd@npm:2.0.0
├─ desandro-matches-selector@npm:2.0.2
├─ destroy@npm:1.2.0
├─ detect-node@npm:2.1.0
├─ dns-equal@npm:1.0.0
├─ dns-packet@npm:5.6.1
├─ dom-converter@npm:0.2.0
├─ dom-serializer@npm:1.4.1
├─ dom-serializer@npm:2.0.0
├─ domelementtype@npm:2.3.0
├─ domhandler@npm:4.3.1
├─ domhandler@npm:5.0.3
├─ domutils@npm:2.8.0
├─ domutils@npm:3.1.0
├─ dot-case@npm:3.0.4
├─ eastasianwidth@npm:0.2.0
├─ ee-first@npm:1.1.1
├─ electron-to-chromium@npm:1.4.610
├─ emoji-regex@npm:8.0.0
├─ emoji-regex@npm:9.2.2
├─ emojis-list@npm:3.0.0
├─ encodeurl@npm:1.0.2
├─ encoding@npm:0.1.13
├─ enhanced-resolve@npm:5.15.0
├─ entities@npm:2.2.0
├─ entities@npm:4.5.0
├─ env-paths@npm:2.2.1
├─ envinfo@npm:7.10.0
├─ eonasdan-bootstrap-datetimepicker@npm:4.17.49
├─ err-code@npm:2.0.3
├─ error-stack-parser@npm:2.1.4
├─ es-module-lexer@npm:1.3.1
├─ escalade@npm:3.1.1
├─ escape-html@npm:1.0.3
├─ escape-string-regexp@npm:1.0.5
├─ escape-string-regexp@npm:4.0.0
├─ eslint-scope@npm:5.1.1
├─ esrecurse@npm:4.3.0
├─ estraverse@npm:4.3.0
├─ estraverse@npm:5.3.0
├─ esutils@npm:2.0.3
├─ etag@npm:1.8.1
├─ ev-emitter@npm:1.1.1
├─ eventemitter3@npm:4.0.7
├─ events@npm:3.3.0
├─ execa@npm:5.1.1
├─ exponential-backoff@npm:3.1.1
├─ expose-loader@npm:4.1.0
├─ express@npm:4.18.2
├─ fast-deep-equal@npm:3.1.3
├─ fast-json-stable-stringify@npm:2.1.0
├─ fast-levenshtein@npm:3.0.0
├─ fastest-levenshtein@npm:1.0.16
├─ faye-websocket@npm:0.11.4
├─ fill-range@npm:7.0.1
├─ finalhandler@npm:1.2.0
├─ find-cache-dir@npm:4.0.0
├─ find-up@npm:3.0.0
├─ find-up@npm:4.1.0
├─ find-up@npm:6.3.0
├─ fizzy-ui-utils@npm:2.0.7
├─ flat@npm:5.0.2
├─ follow-redirects@npm:1.15.3
├─ foreground-child@npm:3.1.1
├─ forwarded@npm:0.2.0
├─ fresh@npm:0.5.2
├─ fs-minipass@npm:2.1.0
├─ fs-minipass@npm:3.0.3
├─ fs-monkey@npm:1.0.5
├─ fs.realpath@npm:1.0.0
├─ fsevents@patch:fsevents@npm%3A2.3.3#optional!builtin<compat/fsevents>::version=2.3.3&hash=df0bf1
├─ function-bind@npm:1.1.2
├─ gauge@npm:4.0.4
├─ gensync@npm:1.0.0-beta.2
├─ get-intrinsic@npm:1.2.2
├─ get-port@npm:3.2.0
├─ get-size@npm:2.0.3
├─ get-stream@npm:6.0.1
├─ glob-parent@npm:5.1.2
├─ glob-to-regexp@npm:0.4.1
├─ glob@npm:10.3.10
├─ glob@npm:7.2.3
├─ globals@npm:11.12.0
├─ globby@npm:6.1.0
├─ gopd@npm:1.0.1
├─ graceful-fs@npm:4.2.11
├─ growly@npm:1.3.0
├─ handle-thing@npm:2.0.1
├─ has-flag@npm:3.0.0
├─ has-flag@npm:4.0.0
├─ has-property-descriptors@npm:1.0.1
├─ has-proto@npm:1.0.1
├─ has-symbols@npm:1.0.3
├─ has-unicode@npm:2.0.1
├─ hasown@npm:2.0.0
├─ he@npm:1.2.0
├─ hpack.js@npm:2.1.6
├─ html-entities@npm:2.4.0
├─ html-minifier-terser@npm:6.1.0
├─ html-webpack-plugin@npm:5.5.4
├─ htmlparser2@npm:6.1.0
├─ http-cache-semantics@npm:4.1.1
├─ http-deceiver@npm:1.2.7
├─ http-errors@npm:1.6.3
├─ http-errors@npm:2.0.0
├─ http-parser-js@npm:0.5.8
├─ http-proxy-agent@npm:5.0.0
├─ http-proxy-middleware@npm:2.0.6
├─ http-proxy@npm:1.18.1
├─ https-proxy-agent@npm:5.0.1
├─ human-signals@npm:2.1.0
├─ humanize-ms@npm:1.2.1
├─ iconv-lite@npm:0.4.24
├─ iconv-lite@npm:0.6.3
├─ icss-utils@npm:5.1.0
├─ immutable@npm:4.3.4
├─ import-local@npm:3.1.0
├─ imports-loader@npm:4.0.1
├─ imurmurhash@npm:0.1.4
├─ indent-string@npm:4.0.0
├─ inflight@npm:1.0.6
├─ inherits@npm:2.0.3
├─ inherits@npm:2.0.4
├─ interpret@npm:3.1.1
├─ ip@npm:2.0.0
├─ ipaddr.js@npm:1.9.1
├─ ipaddr.js@npm:2.1.0
├─ is-binary-path@npm:2.1.0
├─ is-core-module@npm:2.13.1
├─ is-docker@npm:2.2.1
├─ is-extglob@npm:2.1.1
├─ is-fullwidth-code-point@npm:3.0.0
├─ is-glob@npm:4.0.3
├─ is-lambda@npm:1.0.1
├─ is-number@npm:7.0.0
├─ is-path-cwd@npm:2.2.0
├─ is-path-in-cwd@npm:2.1.0
├─ is-path-inside@npm:2.1.0
├─ is-plain-obj@npm:3.0.0
├─ is-plain-object@npm:2.0.4
├─ is-stream@npm:2.0.1
├─ is-wsl@npm:2.2.0
├─ isarray@npm:1.0.0
├─ isexe@npm:2.0.0
├─ isobject@npm:3.0.1
├─ jackspeak@npm:2.3.6
├─ jest-util@npm:29.7.0
├─ jest-worker@npm:27.5.1
├─ jest-worker@npm:29.7.0
├─ jquery-ui@npm:1.13.2
├─ jquery@npm:3.7.1
├─ js-tokens@npm:4.0.0
├─ jsesc@npm:0.5.0
├─ jsesc@npm:2.5.2
├─ json-parse-even-better-errors@npm:2.3.1
├─ json-schema-traverse@npm:0.4.1
├─ json-schema-traverse@npm:1.0.0
├─ json5@npm:2.2.3
├─ kind-of@npm:6.0.3
├─ launch-editor@npm:2.6.1
├─ lazysizes@npm:5.3.2
├─ lilconfig@npm:2.1.0
├─ loader-runner@npm:4.3.0
├─ loader-utils@npm:2.0.4
├─ locate-path@npm:3.0.0
├─ locate-path@npm:5.0.0
├─ locate-path@npm:7.2.0
├─ lodash.debounce@npm:4.0.8
├─ lodash.memoize@npm:4.1.2
├─ lodash.uniq@npm:4.5.0
├─ lodash@npm:4.17.21
├─ lower-case@npm:2.0.2
├─ lru-cache@npm:10.0.1
├─ lru-cache@npm:5.1.1
├─ lru-cache@npm:6.0.0
├─ lru-cache@npm:7.18.3
├─ make-fetch-happen@npm:11.1.1
├─ masonry-layout@npm:4.2.2
├─ mdn-data@npm:2.0.28
├─ mdn-data@npm:2.0.30
├─ media-typer@npm:0.3.0
├─ memfs@npm:3.5.3
├─ merge-descriptors@npm:1.0.1
├─ merge-stream@npm:2.0.0
├─ methods@npm:1.1.2
├─ micromatch@npm:4.0.5
├─ mime-db@npm:1.52.0
├─ mime-types@npm:2.1.35
├─ mime@npm:1.6.0
├─ mimic-fn@npm:2.1.0
├─ mini-css-extract-plugin@npm:2.7.6
├─ minimalistic-assert@npm:1.0.1
├─ minimatch@npm:3.1.2
├─ minimatch@npm:9.0.3
├─ minipass-collect@npm:1.0.2
├─ minipass-fetch@npm:3.0.4
├─ minipass-flush@npm:1.0.5
├─ minipass-pipeline@npm:1.2.4
├─ minipass-sized@npm:1.0.3
├─ minipass@npm:3.3.6
├─ minipass@npm:5.0.0
├─ minipass@npm:7.0.4
├─ minizlib@npm:2.1.2
├─ mkdirp@npm:1.0.4
├─ moment-timezone@npm:0.4.1
├─ moment-timezone@npm:0.5.43
├─ moment@npm:2.29.4
├─ ms@npm:2.0.0
├─ ms@npm:2.1.2
├─ ms@npm:2.1.3
├─ multicast-dns@npm:7.2.5
├─ nanoid@npm:3.3.6
├─ negotiator@npm:0.6.3
├─ neo-async@npm:2.6.2
├─ no-case@npm:3.0.4
├─ node-forge@npm:1.3.1
├─ node-gyp@npm:9.4.0
├─ node-notifier@npm:9.0.1
├─ node-releases@npm:2.0.14
├─ nopt@npm:6.0.0
├─ normalize-path@npm:3.0.0
├─ npm-run-path@npm:4.0.1
├─ npmlog@npm:6.0.2
├─ nth-check@npm:2.1.1
├─ object-assign@npm:4.1.1
├─ object-inspect@npm:1.13.1
├─ obuf@npm:1.1.2
├─ on-finished@npm:2.4.1
├─ on-headers@npm:1.0.2
├─ once@npm:1.4.0
├─ onetime@npm:5.1.2
├─ open@npm:8.4.2
├─ outlayer@npm:2.1.1
├─ p-limit@npm:2.3.0
├─ p-limit@npm:4.0.0
├─ p-locate@npm:3.0.0
├─ p-locate@npm:4.1.0
├─ p-locate@npm:6.0.0
├─ p-map@npm:2.1.0
├─ p-map@npm:4.0.0
├─ p-retry@npm:4.6.2
├─ p-try@npm:2.2.0
├─ param-case@npm:3.0.4
├─ parseurl@npm:1.3.3
├─ pascal-case@npm:3.1.2
├─ path-exists@npm:3.0.0
├─ path-exists@npm:4.0.0
├─ path-exists@npm:5.0.0
├─ path-is-absolute@npm:1.0.1
├─ path-is-inside@npm:1.0.2
├─ path-key@npm:3.1.1
├─ path-parse@npm:1.0.7
├─ path-scurry@npm:1.10.1
├─ path-to-regexp@npm:0.1.7
├─ picocolors@npm:1.0.0
├─ picomatch@npm:2.3.1
├─ pify@npm:2.3.0
├─ pify@npm:4.0.1
├─ pinkie-promise@npm:2.0.1
├─ pinkie@npm:2.0.4
├─ pkg-dir@npm:4.2.0
├─ pkg-dir@npm:7.0.0
├─ pkg-up@npm:3.1.0
├─ postcss-calc@npm:9.0.1
├─ postcss-colormin@npm:6.0.0
├─ postcss-convert-values@npm:6.0.0
├─ postcss-discard-comments@npm:6.0.0
├─ postcss-discard-duplicates@npm:6.0.0
├─ postcss-discard-empty@npm:6.0.0
├─ postcss-discard-overridden@npm:6.0.0
├─ postcss-merge-longhand@npm:6.0.0
├─ postcss-merge-rules@npm:6.0.1
├─ postcss-minify-font-values@npm:6.0.0
├─ postcss-minify-gradients@npm:6.0.0
├─ postcss-minify-params@npm:6.0.0
├─ postcss-minify-selectors@npm:6.0.0
├─ postcss-modules-extract-imports@npm:3.0.0
├─ postcss-modules-local-by-default@npm:4.0.3
├─ postcss-modules-scope@npm:3.0.0
├─ postcss-modules-values@npm:4.0.0
├─ postcss-normalize-charset@npm:6.0.0
├─ postcss-normalize-display-values@npm:6.0.0
├─ postcss-normalize-positions@npm:6.0.0
├─ postcss-normalize-repeat-style@npm:6.0.0
├─ postcss-normalize-string@npm:6.0.0
├─ postcss-normalize-timing-functions@npm:6.0.0
├─ postcss-normalize-unicode@npm:6.0.0
├─ postcss-normalize-url@npm:6.0.0
├─ postcss-normalize-whitespace@npm:6.0.0
├─ postcss-ordered-values@npm:6.0.0
├─ postcss-reduce-initial@npm:6.0.0
├─ postcss-reduce-transforms@npm:6.0.0
├─ postcss-selector-parser@npm:6.0.13
├─ postcss-svgo@npm:6.0.0
├─ postcss-unique-selectors@npm:6.0.0
├─ postcss-value-parser@npm:4.2.0
├─ postcss@npm:8.4.31
├─ pretty-error@npm:4.0.0
├─ process-nextick-args@npm:2.0.1
├─ promise-retry@npm:2.0.1
├─ proxy-addr@npm:2.0.7
├─ punycode@npm:2.3.0
├─ qs@npm:6.11.0
├─ randombytes@npm:2.1.0
├─ range-parser@npm:1.2.1
├─ raw-body@npm:2.5.1
├─ readable-stream@npm:2.3.8
├─ readable-stream@npm:3.6.2
├─ readdirp@npm:3.6.0
├─ rechoir@npm:0.8.0
├─ regenerate-unicode-properties@npm:10.1.1
├─ regenerate@npm:1.4.2
├─ regenerator-runtime@npm:0.14.0
├─ regenerator-transform@npm:0.15.2
├─ regex-parser@npm:2.2.11
├─ regexpu-core@npm:5.3.2
├─ regjsparser@npm:0.9.1
├─ relateurl@npm:0.2.7
├─ renderkid@npm:3.0.0
├─ require-from-string@npm:2.0.2
├─ requires-port@npm:1.0.0
├─ resolve-cwd@npm:3.0.0
├─ resolve-from@npm:5.0.0
├─ resolve-url-loader@npm:5.0.0
├─ resolve@patch:resolve@npm%3A1.22.8#optional!builtin<compat/resolve>::version=1.22.8&hash=c3c19d
├─ retry@npm:0.12.0
├─ retry@npm:0.13.1
├─ rimraf@npm:2.7.1
├─ rimraf@npm:3.0.2
├─ root-workspace-0b6124@workspace:.
├─ safe-buffer@npm:5.1.2
├─ safe-buffer@npm:5.2.1
├─ safer-buffer@npm:2.1.2
├─ sass-loader@npm:13.3.2
├─ sass@npm:1.69.5
├─ schema-utils@npm:3.3.0
├─ schema-utils@npm:4.2.0
├─ select-hose@npm:2.0.0
├─ selfsigned@npm:2.4.1
├─ semver@npm:6.3.1
├─ semver@npm:7.5.4
├─ send@npm:0.18.0
├─ serialize-javascript@npm:6.0.1
├─ serve-index@npm:1.9.1
├─ serve-static@npm:1.15.0
├─ set-blocking@npm:2.0.0
├─ set-function-length@npm:1.1.1
├─ setprototypeof@npm:1.1.0
├─ setprototypeof@npm:1.2.0
├─ shallow-clone@npm:3.0.1
├─ shebang-command@npm:2.0.0
├─ shebang-regex@npm:3.0.0
├─ shell-quote@npm:1.8.1
├─ shellwords@npm:0.1.1
├─ side-channel@npm:1.0.4
├─ signal-exit@npm:3.0.7
├─ signal-exit@npm:4.1.0
├─ smart-buffer@npm:4.2.0
├─ sockjs@npm:0.3.24
├─ socks-proxy-agent@npm:7.0.0
├─ socks@npm:2.7.1
├─ source-map-js@npm:1.0.2
├─ source-map-support@npm:0.5.21
├─ source-map@npm:0.6.1
├─ spdy-transport@npm:3.0.0
├─ spdy@npm:4.0.2
├─ ssri@npm:10.0.5
├─ stackframe@npm:1.3.4
├─ statuses@npm:1.5.0
├─ statuses@npm:2.0.1
├─ string-width@npm:4.2.3
├─ string-width@npm:5.1.2
├─ string_decoder@npm:1.1.1
├─ string_decoder@npm:1.3.0
├─ strip-ansi@npm:6.0.1
├─ strip-ansi@npm:7.1.0
├─ strip-comments@npm:2.0.1
├─ strip-final-newline@npm:2.0.0
├─ style-loader@npm:3.3.3
├─ stylehacks@npm:6.0.0
├─ supports-color@npm:5.5.0
├─ supports-color@npm:7.2.0
├─ supports-color@npm:8.1.1
├─ supports-preserve-symlinks-flag@npm:1.0.0
├─ svgo@npm:3.0.2
├─ sync-rpc@npm:1.3.6
├─ tapable@npm:2.2.1
├─ tar@npm:6.2.0
├─ terser-webpack-plugin@npm:5.3.9
├─ terser@npm:5.22.0
├─ thunky@npm:1.1.0
├─ tmp@npm:0.2.1
├─ to-fast-properties@npm:2.0.0
├─ to-regex-range@npm:5.0.1
├─ toidentifier@npm:1.0.1
├─ tslib@npm:2.6.2
├─ type-is@npm:1.6.18
├─ undici-types@npm:5.26.5
├─ unicode-canonical-property-names-ecmascript@npm:2.0.0
├─ unicode-match-property-ecmascript@npm:2.0.0
├─ unicode-match-property-value-ecmascript@npm:2.1.0
├─ unicode-property-aliases-ecmascript@npm:2.1.0
├─ unique-filename@npm:3.0.0
├─ unique-slug@npm:4.0.0
├─ unpipe@npm:1.0.0
├─ update-browserslist-db@npm:1.0.13
├─ uri-js@npm:4.4.1
├─ util-deprecate@npm:1.0.2
├─ utila@npm:0.4.0
├─ utils-merge@npm:1.0.1
├─ uuid@npm:8.3.2
├─ vary@npm:1.1.2
├─ watchpack@npm:2.4.0
├─ wbuf@npm:1.7.3
├─ webpack-cli@npm:5.1.4
├─ webpack-dev-middleware@npm:5.3.3
├─ webpack-dev-server@npm:4.15.1
├─ webpack-merge@npm:5.10.0
├─ webpack-notifier@npm:1.15.0
├─ webpack-sources@npm:3.2.3
├─ webpack@npm:5.89.0
├─ websocket-driver@npm:0.7.4
├─ websocket-extensions@npm:0.1.4
├─ which@npm:2.0.2
├─ wide-align@npm:1.1.5
├─ wildcard@npm:2.0.1
├─ wrap-ansi@npm:7.0.0
├─ wrap-ansi@npm:8.1.0
├─ wrappy@npm:1.0.2
├─ ws@npm:8.14.2
├─ yallist@npm:3.1.1
├─ yallist@npm:4.0.0
├─ yargs-parser@npm:21.1.1
└─ yocto-queue@npm:1.0.0
PHP version
$ php -v
PHP 8.2.13 (cli) (built: Dec  1 2023 00:01:43) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.13, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.13, Copyright (c), by Zend Technologies

Subject

After upgrading to a version >= 4.24.0 my previously working javascript now throws a cryptic webpack error which I assume derives from a transpilation issue. I also suspect it has something to do with the introduction of Stimulus, but couldn't confirm.

I've tried several things to fix the issue to no avail (eg: replacing require with import for the routes.json file leads to a different error).

Worth noting this is very legacy javascript code that managed to be adapted to symfony/encore thanks to the use of expose-loader, imports-loader & other monkey business.

webpack encore configuration
const Encore = require('@symfony/webpack-encore');
const path = require('path');

// Manually configure the runtime environment if not already configured yet by the "encore" command.
// It's useful when you use tools that rely on webpack.config.js file.
if (!Encore.isRuntimeEnvironmentConfigured()) {
    Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}

Encore
    .setOutputPath('public/build/admin/')
    .setPublicPath('/build/admin')

    .addEntry('fos_routing', './assets/fos_routing.js')
    .addEntry('main', './assets/admin/main.js')
    .addExternals({
        'jQuery': 'jquery', // do not bundle jquery, use sonata's included jquery
    })

    .splitEntryChunks()
    .enableSingleRuntimeChunk()

    .cleanupOutputBeforeBuild()
    .enableBuildNotifications()
    .enableSourceMaps(!Encore.isProduction())
    .enableVersioning(Encore.isProduction())

    .configureBabel((config) => {
        config.plugins.push('@babel/plugin-proposal-class-properties');
    })
    .configureBabelPresetEnv((config) => {
        config.useBuiltIns = 'usage';
        config.corejs = 3;
    })
;

const adminConfig = Encore.getWebpackConfig();
adminConfig.name = 'admin';
Encore.reset();

module.exports = [adminConfig];
fos_routing.js
const routes = require('../var/routes.json');
import Routing from '../vendor/friendsofsymfony/jsrouting-bundle/Resources/public/js/router.min.js';

Routing.setRoutingData(routes);

global.Routing = Routing;
main.js
// css imports
import '../../public/bundles/mybundle/css/custom.css'; // just a plain css file, no sass/less or other transformers.

// javascript imports
import Masonry from 'masonry-layout';

window.onload = function() {
    const container = document.querySelector('.masonry-grid');

    if (container) {
        new Masonry(container, {
            itemSelector: '.grid-item',
            columnWidth: '.grid-item'
        });
    }
}

// other irrelevant app code

Minimal repository with the bug

Don't have one, hard to isolate since it's a legacy application with a lot of legacy javascript code.
Happy to provide more details as requested.

Steps to reproduce

Upgrade to a version >= 4.24

Expected results

Working javascript as before.

Actual results

Javascript code builds just fine like before but the following error can be seen on the browser's console:

router.min.js:1 Uncaught TypeError: __webpack_require__.O is not a function
    at router.min.js:1:4777
    at t (app.js:1:2824)
    at webpackJsonpCallback (jsonp chunk loading:36:1)
    at fos_routing.js:1:53

Uncaught TypeError: __webpack_require__.O is not a function
    at custom.css:1:1
    at t (app.js:1:2824)
    at webpackJsonpCallback (jsonp chunk loading:36:1)
    at main.js:2:53

The first error concerns the inclusion of the FOSRouting js library, the second one concerns a plain css file loaded via import.

@nocive nocive changed the title Uncaught TypeError: __webpack_require__.O is not a function after upgrading to a version w/ Stimulus (>=4.24.0) Uncaught TypeError: __webpack_require__.O is not a function after upgrading to a version >=4.24.0 Dec 14, 2023
@VincentLanglet
Copy link
Member

Maybe @jordisala1991 could help since he introduced stimulus...
but I would say it's hard without the related files...
(Is it because of .addEntry('main', './assets/admin/main.js') ?)

You could try to build less file, until it works to see which are the one with an issue. (Or at least having a smaller reproducer)

@nocive
Copy link
Author

nocive commented Dec 14, 2023

@VincentLanglet I can also provide the contents of main.js or at least the main skeleton of the file (I'll append it to the ticket):

main.js
// css imports
import '../../public/bundles/mybundle/css/custom.css'; // just a plain css file, no sass/less or other transformers.

// javascript imports
import Masonry from 'masonry-layout';

window.onload = function() {
    const container = document.querySelector('.masonry-grid');

    if (container) {
        new Masonry(container, {
            itemSelector: '.grid-item',
            columnWidth: '.grid-item'
        });
    }
}

// other irrelevant code

EDIT: also, to be 100% clear, the code builds fine, the error happens ONLY during runtime in the browser's console.

@nocive
Copy link
Author

nocive commented Dec 14, 2023

Removing main.js does remove the presence of the second error.
If I remove fos_routing then both errors go away, but I'm also left without application javascript code 😅

This is looking more like a transpilation problem related to babel/webpack/foobar.

@nocive
Copy link
Author

nocive commented Dec 22, 2023

Still looking for help here, I've tried the latest SonataAdminBundle minor version and played around with the settings in webpack config to no avail. I found similar error reports which seem to suggest that perhaps core-js and webpack/babel are interfering with each other.

Perhaps my package.json dependencies need to match the same ones as used in Sonata, so that they can be compatible?
I'll attach the contents of package.json to the issue report, if that helps narrow this down.

Going back to SonataAdmin 4.23 always makes the issue go away.

@nocive
Copy link
Author

nocive commented Jan 4, 2024

Looks like it's related with the single runtime chunk functionality, disabling it solves the problem.

@VincentLanglet
Copy link
Member

Looks like it's related with the single runtime chunk functionality, disabling it solves the problem.

Would it be worth opening an issue on webpack or webpack-encore side then ?

@nocive
Copy link
Author

nocive commented Jan 4, 2024

Not sure if this can be labeled as an issue upstream or an issue with our particular setup to be honest.
I'm a bit out of my depth when it comes to webpack black magic.

I ended up having to update the admin webpack encore config to:

-    .enableSingleRuntimeChunk()
+    .disableSingleRuntimeChunk()

and add an additional import for moment using expose-loader to have it available on the global scope for legacy code:

+import moment from 'expose-loader?exposes=moment!moment';

The symfony recommendation is to use single runtime chunk though, hence why we had this to begin with.
Why was it working before the introduction of stimulus and not after is beyond me.

@virtualize
Copy link
Contributor

I can confirm this bug. It seems to come from sonata/form-extensions >= 2.0

Starting with release 4.24.0, SonataAdmin allowed "sonata-project/form-extensions": "^1.15 || ^2.0".
Downgrading to "sonata-project/form-extensions": "^1.15" removes the error.

I suppose this has something to do with switch to stimulus controllers and/or the switch to the new eonasdan/bootstrap-datetimepicker in sonata-project/form-extensions 2.0

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

No branches or pull requests

3 participants