ajv-validator / ajv-validator/ajv

Trouble importing Ajv using cdnjs.

Offen
#2,042 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
compatibility
Vorherrschende Sprache
TypeScript
Sterne
14.8k
Forks
1k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I want to use Ajv on a webpage and I don't want to use a bundler.
So I'm trying to import Ajv from cdnjs, but I get the following error:
```
Uncaught SyntaxError: The requested module 'https://cdnjs.cloudflare.com/ajax/libs/ajv/8.11.0/ajv7.min.js' does not provide an export named 'default' (at validation.js:1:8)
```
It feels like I'm missing something so any help on how to fix this would be appreciated.

**The version of Ajv you are using**
8.11.0
**The environment you have the problem with**
Chrome browser
**Your code (please make it as small as possible to reproduce the issue)**
validation.html:
```




```
validation.js:
```
import Ajv from 'https://cdnjs.cloudflare.com/ajax/libs/ajv/8.11.0/ajv7.min.js';
```
**Results and error messages in your platform**
```
Uncaught SyntaxError: The requested module 'https://cdnjs.cloudflare.com/ajax/libs/ajv/8.11.0/ajv7.min.js' does not provide an export named 'default' (at validation.js:1:8)
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.