We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

ejsInterop error

Getting the following error when trying to use the Dropdown list example below:

Microsoft.JSInterop.JSException: Could not find 'ejsInterop' in 'window'.

Error: Could not find 'ejsInterop' in 'window'.
    at https://localhost:44363/_framework/blazor.server.js:8:30886
    at Array.forEach (<anonymous>)
    at p (https://localhost:44363/_framework/blazor.server.js:8:30847)
    at https://localhost:44363/_framework/blazor.server.js:8:31554
    at new Promise (<anonymous>)
    at e.beginInvokeJSFromDotNet (https://localhost:44363/_framework/blazor.server.js:8:31528)
    at https://localhost:44363/_framework/blazor.server.js:1:19202
    at Array.forEach (<anonymous>)
    at e.invokeClientMethod (https://localhost:44363/_framework/blazor.server.js:1:19173)
    at e.processIncomingData (https://localhost:44363/_framework/blazor.server.js:1:17165)
   at Microsoft.JSInterop.JSRuntime.InvokeWithDefaultCancellation[T](String identifier, Object[] args)
   at Syncfusion.EJ2.Blazor.BaseComponent.OnAfterRenderAsync(Boolean firstRender)
   at Syncfusion.EJ2.Blazor.DropDowns.EjsDropDownList`1.OnAfterRenderAsync(Boolean firstRender)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)

@using Syncfusion.EJ2.Blazor.DropDowns
<div class="col-lg-12 control-section">
    <div class="control_wrapper">
        <EjsDropDownList TValue="string" PopupHeight="230px" Index=2 Placeholder="Select a game" DataSource="@Games">
            <DropDownListFieldSettings Text="Text" Value="ID"></DropDownListFieldSettings>
    .control_wrapper {
        width: 350px;
        margin: 0 auto;
        padding-top: 70px;

5 Replies

NP Narayanasamy Panneer Selvam Syncfusion Team November 6, 2019 01:06 AM

Greetings from Syncfusion support.

We have validated your issue. This error may arise, if your application not having required resources. The reported error will get resolve, once after you referred ejs.interop.js file in ~/Pages/_Host.html.
Make sure that you have included the necessary resources to render Syncfusion Blazor component.

Getting started: 

However, we will refresh the getting started UG documentation with this information. Documentation changes will get refresh in upcoming weekly patch release, which is scheduled on first mid of November 2019. We appreciate your patience until then.

Narayanasamy P. 

AG Ashwani Gusain January 8, 2020 12:17 PM

and how to refer ejs.interop.js Host file?

SP Sureshkumar P Syncfusion Team January 9, 2020 07:54 AM

Hi Daniel, 
As per our previous update. Please follow the getting started documentation link to render the Syncfusion component. 
We have created a sample based on your requirement. please refer the sample here: https://www.syncfusion.com/downloads/support/forum/148831/ze/DropDownlist-290734837  
Sureshkumar P 

KD Kevin Dahl March 18, 2020 07:24 PM

I'm trying syncfusion out with the autocomplete control in a Blazor server application.

I had to include ejs.interop-ie.min.js (which is what is in the DatePicker example) to get rid of the "Could not find 'ejsInterop' in 'window'".

Now I get the the following error:

SourceMaps.getMapForGeneratedPath: exception while processing path: https://cdn.syncfusion.com/ej2/17.4.55/dist/ej2.min.js, sourcemap: ej2.min.js.map
SyntaxError: Unexpected token  in JSON at position 0
    at JSON.parse (<anonymous>)
    at new SourceMap (C:\ProgramData\Microsoft\VisualStudio\ChromeAdapter\63fcb39bode_modules\vscode-chrome-debug-core\out\src\sourceMaps\sourceMap.js:19:25)
    at sourceMapContentsP.then.contents (C:\ProgramData\Microsoft\VisualStudio\ChromeAdapter\63fcb39bode_modules\vscode-chrome-debug-core\out\src\sourceMaps\sourceMapFactory.js:58:28)
    at process._tickCallback (internal/process/next_tick.js:68:7)

I also downloaded and tried out the datepicker sample application. Loaded it and got the following errors:
Verbose logs are written to:

Microsoft.Hosting.Lifetime: Information: Content root path: K:\Research\Blazor\DropDownList\DatePicker\DatePicker
A cookie associated with a cross-site resource at https://github.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032. [https://localhost:44324/]
SourceMaps.getMapForGeneratedPath: exception while processing path: https://cdn.syncfusion.com/ej2/17.4.42/dist/ej2.min.js, sourcemap: ej2.min.js.map
SyntaxError: Unexpected token  in JSON at position 0
    at JSON.parse (<anonymous>)
    at new SourceMap (C:\ProgramData\Microsoft\VisualStudio\ChromeAdapter\63fcb39bode_modules\vscode-chrome-debug-core\out\src\sourceMaps\sourceMap.js:19:25)
    at sourceMapContentsP.then.contents (C:\ProgramData\Microsoft\VisualStudio\ChromeAdapter\63fcb39bode_modules\vscode-chrome-debug-core\out\src\sourceMaps\sourceMapFactory.js:58:28)
    at process._tickCallback (internal/process/next_tick.js:68:7)
[2020-03-19T00:20:55.532Z] Information: Normalizing '_blazor' to 'https://localhost:44324/_blazor'.
[2020-03-19T00:20:55.783Z] Information: WebSocket connected to wss://localhost:44324/_blazor?id=joU2G2p7mycc9CFFguvTmQ.

It appears to me, there is still a problem with this stuff or it's a permissions issue someplace.

SP Sureshkumar P Syncfusion Team March 19, 2020 07:45 AM

Hi Kevin, 
Greetings from Syncfusion support. 
Based on your shared information with error details, we suspect that you have referred the ejs.interop file before the  ej2.min.js file. That is the reason for this issue. So, we suggest you to refer the ejs.interop file after referred the ej2.min.js file to resolve your issue. 
Sureshkumar P 

Live Chat Icon For mobile
Up arrow icon