Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Microsoft.JSInterop.JSException: Cannot set properties of undefined (setting ‘moment’) TypeError


Hi,

I get below error

blazor.server.js:1 [2022-02-23T20:44:39.025Z] Error: Microsoft.JSInterop.JSException: Cannot set properties of undefined (setting ‘moment’) TypeError: Cannot set properties of undefined (setting ‘moment’) at at at Microsoft.JSInterop.JSRuntime.InvokeAsyncTValue at BlazorApp.Shared.MainLayout.OnAfterRenderAsync(Boolean firstRender) in /Users/kardohussein/Desktop/Korek/mohe/BlazorApp/Shared/MainLayout.razor:line 4007 at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (6)


Is this issue fixed? Trying hard to make js script files work with Blazor apps.



I'm experiencing same issue with Laravel Vite.



Hi,

Did you manage to solve issue? I'm having same problem and being stuck for days. I can not figure how to make it work with Blazor server...Can somebody post image with proper folder structure?



Hi,

Yes, we reproduced this issue, we will check it and fix it as soon as possible.

The issue appears only when you bundle assets with a gulp, webpack seems to be working fine.
Could you please try to rebuild your assets with a webpack?

Check our webpack build doc:
https://preview.keenthemes.com/metronic8/demo1/documentation/getting-started/build/webpack.html



are you able to fix this?



Web pack is not working on html download.
https://devs.keenthemes.com/metronic/html/demo17/download

Can you let me know what to do for that?


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(