RocketChat / RocketChat/Rocket.Chat

Exception while invoking method 'loadLocale' Error: Unknown asset: moment-locales/2.js

Open
#30,417 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

I'm seeing these errors in my rocketchat-logs. I think it might be causing an issue with the Omnichannel business hours features not setting the time correctly. It seems to be setting it to UTC time instead of server time.

Steps to reproduce:
  1. Start rocketchat
  2. Errors will appear after a minute or 2.

Error could also be trigger if I can my localization in my profile page.

Expected behavior:

No errors. Business hours should be set with server time and not UTC

Actual behavior:

Only thing I'm noticing is that business hours aren't working. Current workaround is to just turn off that feature for now.

Server Setup Information:
  • Version of Rocket.Chat Server: 6.3.4
  • Operating System: CentOS 7
  • Deployment Method:docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version: v14.21.3
  • MongoDB Version: 5.0.20
Client Setup Information
  • Desktop App or Browser Version: 3.9.6
  • Operating System: MacOS
Relevant logs:

meteor-rocketchat-1 | Exception while invoking method 'loadLocale' Error: Unknown asset: moment-locales/2.js
meteor-rocketchat-1 | at getAsset (/app/bundle/programs/server/boot.js:303:21)
meteor-rocketchat-1 | at Object.getTextAsync (/app/bundle/programs/server/boot.js:318:18)
meteor-rocketchat-1 | at server/lib/getMomentLocale.ts:7:17
meteor-rocketchat-1 | at /app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40
meteor-rocketchat-1 | => awaited here:
meteor-rocketchat-1 | at Function.Promise.await (/app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:56:12)
meteor-rocketchat-1 | at getCurrentMethodInvocationResult (packages/ddp-server/livedata_server.js:781:32)
meteor-rocketchat-1 | at packages/meteor.js:365:18
meteor-rocketchat-1 | at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1389:31)
meteor-rocketchat-1 | at packages/ddp-server/livedata_server.js:791:46
meteor-rocketchat-1 | at new Promise ()
meteor-rocketchat-1 | at Session.method (packages/ddp-server/livedata_server.js:739:23)
meteor-rocketchat-1 | at packages/ddp-server/livedata_server.js:603:43

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with server/lib/getMomentLocale.ts and reproduce the loadLocale call using the reported Rocket.Chat setup. Trace why the moment-locales/2.js asset is unavailable, then verify that the error no longer appears and that Omnichannel business hours use the expected server time.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend, internationalization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.