Skip to content

Conversation

@susnux
Copy link
Contributor

@susnux susnux commented Jan 10, 2024

In some circumstances Webpack fails to resolve the module, this breaks e.g. forms 3.x.

So we need the explicit file extension to fix it.

@raimund-schluessler
Copy link

@susnux vitest has the same problem, see nextcloud/tasks#2450

@susnux susnux merged commit c2d3845 into master Jan 10, 2024
@susnux susnux deleted the fix/make-module-resolution-explicit branch January 10, 2024 20:19
@ShGKme
Copy link

ShGKme commented Jan 15, 2024

It breaks Webpack build for Talk.

It cannot now require ('./locale/' + name); from the moment/min/moment-with-locales.js cause locales is not in the same directory and cannot be resolved from moment-with-locales.js.

WARNING in ./spreed/node_modules/moment/min/moment-with-locales.js 2159:16-50
Module not found: Error: Can't resolve './locale' in '<...>\talk-desktop\spreed\node_modules\moment\min'

@ShGKme
Copy link

ShGKme commented Jan 15, 2024

But I cannot understand how it was supposed to work in moment...

How it was possible what

require('./locale/' + name)

Worked from here

moment/
├── locale/
├── min/
│  ├── locales.js
│  ├── locales.min.js
│  ├── locales.min.js.map
│  ├── moment-with-locales.js           <-- from here
│  ├── moment-with-locales.min.js
│  ├── moment-with-locales.min.js.map
│  ├── moment.min.js                     
│  └── moment.min.js.ma

Without any configs in package.json or patching require...

@ShGKme
Copy link

ShGKme commented Jan 16, 2024

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants