-
-
Notifications
You must be signed in to change notification settings - Fork 533
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
Uncaught SyntaxError: Unexpected token AND 'blazorise' was undefined #2301
Comments
So it seems null optional chaining is not supported on one of your browsers. I will replace it with regular syntax and release it as a part of the next patch. Thanks for your help! |
Ah this again... damn. |
@David-Moreira |
It is an old chrome version. That explains a lot. Mine is 90.0.4430.85 |
PS. And all I wanted to do is to use some new JavaScript features 😭🤣 |
@stsrki Also, I directly referenced your project source code to locate the problem. If I had used nuget "install..." If I can't see the source code, I have no idea what this error means. Syntax sugar is good, but also poison 😊 |
I understand the problem, but being one guy doing almost all the work it's not easy. So taking care of backward compatibility with other work is the last option. Things could change soon... 😎😶 Regarding support for IE7, 8, 9, 10, is not an option since Blazor itself doesn't support them. |
The fix was released as part of the 0.9.3.3 patch. @wartim what version do you use? |
0.9.3.6 |
Try hitting Ctrl+F5 to clear the browser cache. |
PS. I will definitely need to mention in the docs to add version on static files, eg <script src="_content/Blazorise/blazorise.js?v=0.9.3.6"></script>
<script src="_content/Blazorise.Bootstrap/blazorise.bootstrap.js?v=0.9.3.6"></script> |
The "master" version was downloaded on May 1st. It is 0.9.3.6 according to the instructions. I found that you updated it 2 hours ago. Maybe I should download it again. |
OK |
The master branch only contains the latest release for the live documentation. The actual patches are on the sup093 branch. |
Okay, I have downloaded sup093. |
dev093 was the development branch up to the point when 0.9.3 was released. From there on all new patches go to sup093(release branch), and dev094 is for new work only. The master branch is left in the state when dev093 was last merged, plus some changes in the documentation, mainly release notes for patches. Once dev094 is finished the same cycle all over again. |
I plan to make slight changes in this workflow soon. Probably after v.1.0 is released. Being thinking lately that 0.9.4 might be the last beta version. |
1 My computer at home works normally, but there is an error in my company's computer: 'blazorise' was undefined
2 Then I found out that the sentence was wrong:
if (values && values.find(x => x?.toString() === opt.value)) {
opt.selected = true;
} else {
opt.selected = false;
}
3 Then I change it to this, and it will run normally. Is it the compatibility problem of the browser?
if (values && values.find(x => x === null ? null === opt.value : x.toString() === opt.value)) {
opt.selected = true;
} else {
opt.selected = false;
}
Error details:
Uncaught SyntaxError: Unexpected token .
blazor.server.js:1 [2021-05-06T06:29:09.681Z] Information: Normalizing '_blazor' to 'http://localhost:5000/_blazor'.
blazor.server.js:1 [2021-05-06T06:29:09.879Z] Information: WebSocket connected to ws://localhost:5000/_blazor?id=CRkyLOMBJ9v4v3RSnhw7bQ.
blazor.server.js:21 [2021-05-06T06:29:10.024Z] Error: Microsoft.JSInterop.JSException: Could not find 'blazorise.button.initialize' ('blazorise' was undefined).
Error: Could not find 'blazorise.button.initialize' ('blazorise' was undefined).
at http://localhost:5000/_framework/blazor.server.js:1:67390
at Array.forEach ()
at e.findFunction (http://localhost:5000/_framework/blazor.server.js:1:67350)
at v (http://localhost:5000/_framework/blazor.server.js:1:69092)
at http://localhost:5000/_framework/blazor.server.js:1:70038
at new Promise ()
at e.beginInvokeJSFromDotNet (http://localhost:5000/_framework/blazor.server.js:1:70011)
at http://localhost:5000/_framework/blazor.server.js:1:26293
at Array.forEach ()
at e.invokeClientMethod (http://localhost:5000/_framework/blazor.server.js:1:26263)
at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
at Blazorise.Button.b__9_0() in D:\s9net5\Blazorise-master\Source\Blazorise\Components\Button\Button.cs:line 65
at Blazorise.Base.BaseAfterRenderComponent.OnAfterRenderAsync(Boolean firstRender) in D:\s9net5\Blazorise-master\Source\Blazorise\Base\BaseAfterRenderComponent.cs:line 46
at Blazorise.BaseComponent.OnAfterRenderAsync(Boolean firstRender) in D:\s9net5\Blazorise-master\Source\Blazorise\Base\BaseComponent.cs:line 62
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)
e.log @ blazor.server.js:21
I @ blazor.server.js:10
(anonymous) @ blazor.server.js:10
(anonymous) @ blazor.server.js:1
e.invokeClientMethod @ blazor.server.js:1
e.processIncomingData @ blazor.server.js:1
connection.onreceive @ blazor.server.js:1
i.onmessage @ blazor.server.js:1
blazor.server.js:1 [2021-05-06T06:29:10.033Z] Information: Connection disconnected.
5blazor.server.js:1 Uncaught (in promise) Error: Cannot send data if the connection is not in the 'Connected' State.
at e.send (blazor.server.js:1)
at e.sendMessage (blazor.server.js:1)
at e.sendWithProtocol (blazor.server.js:1)
at e.send (blazor.server.js:1)
at Object.endInvokeJSFromDotNet (blazor.server.js:10)
at blazor.server.js:1
The text was updated successfully, but these errors were encountered: