Skip to content
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.

Uncaught ReferenceError #94

Closed
redowl3 opened this issue Sep 26, 2019 · 8 comments · Fixed by #98
Closed

Uncaught ReferenceError #94

redowl3 opened this issue Sep 26, 2019 · 8 comments · Fixed by #98
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@redowl3
Copy link

redowl3 commented Sep 26, 2019

I've probably missed a step somewhere but when I run using Blazor (server side) latest

I get

: Blazor is not defined at ChartJsInterop.js:5

when I check the console window. Any ideas?

@redowl3 redowl3 added the bug Something isn't working label Sep 26, 2019
@Joelius300
Copy link
Owner

Joelius300 commented Sep 26, 2019

This error will occur if you include the javascript from our library before including the javascript for blazor itself. For server-side this would mean that _framework/blazor.server.js was included after _content/ChartJs.Blazor.Fork/ChartJsInterop.js. If that's the case in your project, try including the _framework-stuff before anything else and report back to us if it worked. If it didn't, please show us the code in your _Host.cshtml (since you're running server-side); we can try fixing it from there.

You should always include the framework stuff first when working with blazor but if necessary we can mention that in the setup steps of the readme.

@redowl3
Copy link
Author

redowl3 commented Sep 26, 2019

Thanks for the response - just tried that and works great.

@Joelius300
Copy link
Owner

Awesome :)

I won't close this issue right now since this is a good reminder to put the disclaimer in the readme.

@Joelius300 Joelius300 added the documentation Improvements or additions to documentation label Sep 26, 2019
@SeppPenner
Copy link
Contributor

I have documented this under the known issues: https://github.com/Joelius300/ChartJSBlazor/wiki/Known-issues#uncaught-reference-error-blazor-is-not-defined-at-chartjsinteropjs5.

We should put this to the readme as well.

@SeppPenner
Copy link
Contributor

SeppPenner commented Sep 27, 2019

I put it to the getting started section as well: https://github.com/Joelius300/ChartJSBlazor/wiki/Getting-started.

Todo: Add this to the readme as well.

@Joelius300 do you think the way I described the issue is sufficient?

@Joelius300
Copy link
Owner

known issues

You need to add it for client-side as well. The error should occur there too but I think it's a different js you need to include. You can test that with a client-side application and you will also be able to see what js-file is included for blazor in index.html. Then you can mention that in the wiki.

Also, I see that you also used 'try to..'. I only said that because I wasn't 100% sure if that was the issue they were experiencing. In this case we're describing this exact issue and we exactly know how to fix it so you should write something like 'to fix it you have to..'.

getting started

It shouldn't be its own Step. Just call it 'disclaimer' or so under step 4 instead of making it step 5.

@SeppPenner
Copy link
Contributor

I will work on all this documentation things today in the evening (I have more time then).

@SeppPenner
Copy link
Contributor

Known issues:

  • Add info for the client-side as well.
  • Remove 'try to'

Getting started:

  • Made step 5 Disclaimer under step 4

I will update the readme and afterwards this issue can be closed as well @Joelius300: #98

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
3 participants