0

I'm trying to use BrowserSolc in my dApp, but it's just not loading, it seems. I've got browser-solc.min.js in the same folder as index.html, with the following near the top of the page:

<script language="javascript" type="text/javascript" src="browser-solc.min.js"></script>
  • and later:
BrowserSolc.getVersions(function(soljsonSources, soljsonReleases) {
  console.log(soljsonSources);
  console.log(soljsonReleases);
});

This results in an Uncaught ReferenceError: BrowserSolc is not defined.

What am I missing?

0

Assuming that is a TypeScript compile error, add a file at src/typings.d.ts containing:

declare var BrowserSolc: any;

That just let's the compiler know that BrowserSolc is a real thing even tho it can't see it (because the TypeScript compiler does not load the scripts in tags).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.