Skip to content
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

Environment variable different from Developement. #3744

Open
jerpic opened this issue Mar 20, 2024 · 6 comments
Open

Environment variable different from Developement. #3744

jerpic opened this issue Mar 20, 2024 · 6 comments

Comments

@jerpic
Copy link

jerpic commented Mar 20, 2024

Hello,

I'm facing to a problem, if my environment variable "ASPNETCORE_ENVIRONMENT" is different from "Development" I got a this error message when my application start.

"Microsoft.JSInterop.JSException: Could not find 'AntDesign.interop.domInfoHelper.getInfo' ('AntDesign' was undefined).
Error: Could not find 'AntDesign.interop.domInfoHelper.getInfo' ('AntDesign' was undefined)"

I'm using the AntDesign 0.18.0 with .NET 7.

Any help would be appreciated.

@ElderJames
Copy link
Member

Thanks for contacting us @jerpic . What hosting model did you run, Server or WebAssembly?

@jerpic
Copy link
Author

jerpic commented Mar 20, 2024

Hello @ElderJames,

I'm using the Server hosting model.

@jerpic
Copy link
Author

jerpic commented Mar 21, 2024

Hello @ElderJames,

Did you reproduce it or it's only on my side?

Regards.

@ElderJames
Copy link
Member

@jerpic I can't reproduce the issue.

@zkhssb
Copy link

zkhssb commented Mar 28, 2024

There is no problem using the Nuget version, but when I try to download the source code and compile it myself, I encounter the same problem. Using Visual Studio to compile automatically opens a browser window that can use the website normally, but when I try to use other browsers, an exception is thrown. The solution in #3078 is to publish the project, which can solve this problem (it is still unclear what caused it).

[18:17:41 WRN] Unhandled exception rendering component: Could not find 'AntDesign.interop.domInfoHelper.getInfo' ('AntDesign' was undefined).
Error: Could not find 'AntDesign.interop.domInfoHelper.getInfo' ('AntDesign' was undefined).
    at http://localhost:5000/_framework/blazor.server.js:1:734
    at Array.forEach (<anonymous>)
    at l.findFunction (http://localhost:5000/_framework/blazor.server.js:1:702)
    at _ (http://localhost:5000/_framework/blazor.server.js:1:5445)
    at http://localhost:5000/_framework/blazor.server.js:1:3238
    at new Promise (<anonymous>)
    at y.beginInvokeJSFromDotNet (http://localhost:5000/_framework/blazor.server.js:1:3201)
    at Xt._invokeClientMethod (http://localhost:5000/_framework/blazor.server.js:1:61001)
    at Xt._processIncomingData (http://localhost:5000/_framework/blazor.server.js:1:58476)
    at Xt.connection.onreceive (http://localhost:5000/_framework/blazor.server.js:1:52117)
Microsoft.JSInterop.JSException: Could not find 'AntDesign.interop.domInfoHelper.getInfo' ('AntDesign' was undefined).
Error: Could not find 'AntDesign.interop.domInfoHelper.getInfo' ('AntDesign' was undefined).
    at http://localhost:5000/_framework/blazor.server.js:1:734
    at Array.forEach (<anonymous>)
    at l.findFunction (http://localhost:5000/_framework/blazor.server.js:1:702)
    at _ (http://localhost:5000/_framework/blazor.server.js:1:5445)
    at http://localhost:5000/_framework/blazor.server.js:1:3238
    at new Promise (<anonymous>)
    at y.beginInvokeJSFromDotNet (http://localhost:5000/_framework/blazor.server.js:1:3201)
    at Xt._invokeClientMethod (http://localhost:5000/_framework/blazor.server.js:1:61001)
    at Xt._processIncomingData (http://localhost:5000/_framework/blazor.server.js:1:58476)
    at Xt.connection.onreceive (http://localhost:5000/_framework/blazor.server.js:1:52117)
   at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
   at AntDesign.AntComponentBase.JsInvokeAsync[T](String code, Object[] args) in D:\Codes\C#\EasyBot\AntDesignBlazor\components\core\Base\AntComponentBase.cs:line 85
   at AntDesign.Alert.OnAfterRenderAsync(Boolean firstRender) in D:\Codes\C#\EasyBot\AntDesignBlazor\components\alert\Alert.razor.cs:line 151
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

Note that I have not modified the code in Alert.razor.cs or AntComponentBase.cs, and that I am using the 0.18.1 version of AntDesign with . NET version 8.0.

@ElderJames
Copy link
Member

Hello @zkhssb , please rebuild the solusion so that the js asset would be generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants