Build issues after upgrading to v2.39

As far as I can see, there are some major changes in a build process in newest version.

Error is:
> Bundling ./src/xdnRoutes.ts and xdn.config.js… (node:3450) [DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET] DeprecationWarning: Compilation.modules was changed from Array to Set (using Array method ‘reduce’ is deprecated)
(Use node --trace-deprecation ... to show where the warning was created)
(node:3450) [DEP_WEBPACK_MODULE_ERRORS] DeprecationWarning: Module.errors was removed (use getErrors instead)
done.
Error: ENOENT: no such file or directory, scandir ‘/monorepo/src/js/web/.xdn/lambda/static/locales/en’
at Object.readdirSync (fs.js:981:3)
at getAllNamespaces (/monorepo/src/js/web/.xdn/lambda/routes.js:2:330775)
at _default /monorepo/src/js/web/.xdn/lambda/routes.js:2:330878)
at new e (/monorepo/src/js/web/.xdn/lambda/routes.js:2:339491)
at Module.26659 (/monorepo/src/js/web/.xdn/lambda/routes.js:2:555010)
at webpack_require (/monorepo/src/js/web/.xdn/lambda/routes.js:2:585413)
at /monorepo/src/js/web/.xdn/lambda/routes.js:2:586080
at/monorepo/src/js/web/.xdn/lambda/routes.js:2:586108
at /monorepo/src/js/web/.xdn/lambda/routes.js:2:84
at Object. (/Users/artur/Documents/work/projects/monorepo/src/js/web/.xdn/lambda/routes.js:2:223)
at Module._compile (internal/modules/cjs/loader.js:1075:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:1096:10)
at Module.load (internal/modules/cjs/loader.js:940:32)
at Function.Module._load (internal/modules/cjs/loader.js:781:14)
at Module.require (internal/modules/cjs/loader.js:964:19)
at require (internal/modules/cjs/helpers.js:88:18) {
errno: -2,
syscall: ‘scandir’,
code: ‘ENOENT’,
path: ‘/Users/artur/Documents/work/projects/monorepo/src/js/web/.xdn/lambda/static/locales/en’
}

v2.34 directory structure(please note lambda/static and other directories are there)

v2.39 - not sure if it’s related to an error but assets aren’t there
2.39

i18n library is trying to get language files this way in xdn routes.js:
getAllNamespaces(path.join(process.cwd(), "".concat(localePath, "/").concat(defaultLanguage)))
where localePath = static/locales

The main problem now is that working directory is different when app builds and routes build. I cannot even use ENV var to specify the path for routes, since xdn build is a single terminal command

We had to create custom connector in order to make things works again Moovweb XDN Documentation - Connectors

1 Like