ajv-validator / ajv-validator/ajv

Trouble importing Ajv using cdnjs.

未关闭
#2,042 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
compatibility
主要语言
TypeScript
星标
14.8k
派生
1k
PR 合并指标
30 天内没有已合并 PR

描述

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)
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。