[SOLVED] Moralis is not defined, error when trying to log in with metamask

Now all of a sudden when I try to run my moralis app Im getting this error

Uncaught ReferenceError: Moralis is not defined

I have never seen this error before, why do I get this now?

In addition to above error I get this notification in my console.
The resource from “https://unpkg.com/[email protected]/dist/moralis.js” was blocked due to MIME type (“text/plain”) mismatch (X-Content-Type-Options: nosniff).

Line 3 is moralis start

const serverUrl = "";
const appId = "";
Moralis.start({ serverUrl, appId });

There was a recent change. Use this cdn.
https://unpkg.com/[email protected]/dist/moralis.js

Read more here: Moralis-v1 support August 8, 2022

Iam but its still not working

<script src="https://unpkg.com/[email protected]/dist/moralis.js"></script>

<!-- Latest compiled and minified CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">

<!-- Latest compiled JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>

Are you still receiving the same error or do you see a different error?

Ich seh jetzt sogar mehr errors

GEThttps://unpkg.com/[email protected]/dist/moralis.js[HTTP/2 404 Not Found 192ms]

Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content. node.js:393

The resource from “https://unpkg.com/[email protected]/dist/moralis.js” was blocked due to MIME type (“text/plain”) mismatch (X-Content-Type-Options: nosniff).

keys.html

GEThttps://unpkg.com/[email protected]/dist/moralis.js[HTTP/2 404 Not Found 73ms]

The resource from “https://unpkg.com/[email protected]/dist/moralis.js” was blocked due to MIME type (“text/plain”) mismatch (X-Content-Type-Options: nosniff).

keys.html

Loading failed for the with source “https://unpkg.com/moralis/dist/moralis.js”. keys.html:16:1

Uncaught ReferenceError: Moralis is not defined

This error is still showing the old cdn url. Try restarting the localhost after saving new cdn in html.

Sorry, i got confused with english and german :wink:

Its working now I have the cdn on all of my sites and forgot to replace it on other pages on my site
its working now

1 Like