is there a bug in 6.1.3 around module resources not getting registered? #5491
Replies: 7 comments 2 replies
-
|
maybe this #5323 |
Beta Was this translation helpful? Give feedback.
-
|
@markdav-is you have not provided any of the details necessary to troubleshoot ie. if the site is using interactive or static render mode, if the module is using interactive or static render mode, etc... JavaScript resources are handled completely differently based on render mode. |
Beta Was this translation helpful? Give feedback.
-
|
@markdav-is I am not aware of any issues with Resources in recent versions. If the Resources are declared in index.razor I would suggest specifying Url = ModulePath() + "Module.js" rather than using tilde (as tilde was introduced for Resources declared in ModuleInfo.cs where ModulePath is not available). I would also validate that the folder name under wwwroot/Modules EXACTLY matches the namespace of your module ie. the exact value specified by @namespace in your index.razor file. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the quick answer. I was able to create a new test module and the JS file shows up properly so It's something I'm doing that's out -of-pattern. you can ignore me, I'll post the final answer when i figure it out. |
Beta Was this translation helpful? Give feedback.
-
|
I was never able to get the module.js loading and eventually added the missing script to the theme as a work-around. I'll be on the lookout for other projects with similar issues. Super obscure. |
Beta Was this translation helpful? Give feedback.
-
|
I did find an anomoly with JavaScript resources - but I am not sure if its the same problem you encountered. When using the following configuration:
The framework is injecting 2 script tags into the DOM for the same resource. Since the general goal in Oqtane is to hide complexity from developers and allow them to write logic which works consistently across different render modes, I believe the correct behavior in this case is that the framework should NOT automatically inject a module's script resources within App.razor if the module component is using Interactive render mode - as when Interactive render mode is specified (for either a Site or a Module) the component should rely solely on JS Interop and OnAfterRenderAsync. |
Beta Was this translation helpful? Give feedback.
-
|
I've found . . . . |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm pulling my hair out trying to figure out why my module index action razor component is not registering it's resources. I can set a breakpoint on the Resources definition and it get's called, but never gets added to the page. Not in Debug or when deployed. Seems like his was working, but maybe something changed in 6.1.3? Before I upgrade to 6.1.4 looking for a fix, is this a known issue? I tried adding resource locations and exact URLs, but they are not getting rendered.
Beta Was this translation helpful? Give feedback.
All reactions