Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I am building a custom-visul for Power BI. When I have added momentjs, my script sort of "hangs" as soon as I try to use it in my visual.ts. I dont get an error message or exepction or anything else. Using the lines below
console.log('Trying moment.js'); console.log(moment); console.log('Moment-testing success');
it "stops" after outputting Trying moment.js. I have no trouble running pbiviz start.
These are the steps i have taken to install momentjs:
Is there something I have missed? It feels like my application cant find the actual moment.js and resolve what moment is...
Hi, you may have seen this thread where I posted about using moment.js in custom visuals. It may give you a starting point.
To me, the issue was not so much about anything Power BI related, but instead was related to the moment namespace issues and integration with Typescript. I could never call console.log(moment) because moment was not recognized.
In the end, I didn't end up needing moment so I didn't work through to a final solution.
good luck!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
6 | |
4 | |
2 | |
2 |
User | Count |
---|---|
4 | |
3 | |
3 | |
3 | |
3 |