-
Notifications
You must be signed in to change notification settings - Fork 3
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
fix: ignore ./locale
import from moment/min/moment-with-locales
#533
Conversation
@nextcloud/moment since v1.3.0 uses `moment/min/moment-with-locales.js`. Which works only in Node.js and is not compatible with Webpack bundling. It has an unused function `localLocale` that requires locales by invalid relative path `./locale`. Though it is not used, Webpack tries to resolve it with `require.context` and fails. Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
A fix on |
How would you fix it? The problem is that we otherwise need to import every local in |
I dunno, that is why I mentioned you =D I didn't dig much into what happens in Probably, Anyway, I'm fine with merging this PR to fix the problem as well. |
This does only work with local imports not with modules 😶 |
Fixes compatibility between
@nextcloud/webpack-vue-config
and@nextcloud/moment@1.3.0
(since migration to Vite).@nextcloud/moment
usesmoment/min/moment-with-locales.js
, which works only in Node.js and is not compatible with Webpack bundling. It has an unused functionlocalLocale
that requires locales by invalid relative path./locale
. Though it is not used, Webpack tries to resolve it withrequire.context
and fails.Example of issue in Talk, same in Text and other apps:
See also:
@nextcloud/moment
: https://github.com/nextcloud-libraries/nextcloud-moment/blob/c73f43f7e7713a92bad98251aad22b3cd57a757e/lib/index.ts#L1moment/min/moment-with-locales.js
: https://github.com/moment/moment/blob/develop/min/moment-with-locales.js#L2159